<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ include file="/resources/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>课程学习 | 中国医学教育慕课联盟官方平台</title>
    <meta http-equiv="X-UA-Compatible" content=" IE=EmulateIE9;IE=EmulateIE10;IE=EmulateIE11" />
    <link rel="shortcut icon" type="image/x-icon" href="${ctx}/resources/images/mooc.ico" />
    <link rel="stylesheet" type="text/css" href="${ctx}/relfile/css/course.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/relfile/css/class.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/relfile/css/study_video.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/relfile/css/basic-sanqi.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/relfile/css/start-talk.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/relfile/css/talk_details.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/js/jquery-easyui-1.4.3/themes/gray/easyui.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/js/jquery-easyui-1.4.3/themes/icon.css" />

    <!-- h5播放器样式 -->
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/css/h5Player/public.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/css/h5Player/video-js.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/css/h5Player/videojs.thumbnails.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/css/h5Player/dolit-player.css?v=12" />
    <link rel="stylesheet" type="text/css" href="${ctx}/resources/css/h5Player/iconfont.css" />
    <style>
      @media (max-width: 767px) {
        #video-box {
          width: 100%;
          height: 320px;
        }
      }
      @media (min-width: 767px) {
        #video-box {
          width: 77%;
          height: 49vh;
        }
      }
    </style>
    <!-- /h5播放器样式 -->

    <!-- h5播放器相关JS -->
    <script src="http://www.pmphmooc.com/api/m3u8/url?protocol_type=http&v=5"></script>
    <script type="text/javascript" src="${ctx}/resources/js/h5Player/jquery.min.js"></script>
    <script type="text/javascript" src="${ctx}/resources/js/h5Player/crypto-js.js"></script>
    <script type="text/javascript" src="${ctx}/resources/js/h5Player/dolithls.min.js"></script>
    <script type="text/javascript" src="${ctx}/resources/js/h5Player/video.min.js"></script>
    <script type="text/javascript" src="${ctx}/resources/js/h5Player/videojs.thumbnails.js"></script>
    <script type="text/javascript" src="${ctx}/resources/js/h5Player/dolit-player.js?v=9261"></script>
    <!-- /h5播放器相关JS -->

    <script type="text/javascript" src="${ctx}/resources/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${ctx}/resources/js/layer/layer.js"></script>
    <script type="text/javascript" src="${ctx}/relfile/jq/jquery.form.js"></script>
    <script type="text/javascript" src="${ctx}/relfile/jq/course.js"></script>
    <script type="text/javascript" src="${ctx}/relfile/jq/json2.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/resources/ueditor-1.4.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/resources/ueditor-1.4.3/ueditor.all.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/resources/ueditor-1.4.3/lang/zh-cn/zh-cn.js"></script>
    <%--
    <script src="${ctx}/relfile/jq/videosub-0.9.9.js"></script>
    --%>
    <script src="${ctx}/relfile/jq/jwplayer.js"></script>
    <script src="${ctx}/relfile/jq/common.js"></script>
    <script type="text/javascript" src="${ctx}/resources/js/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${ctx}/relfile/jq/echarts.js"></script>
    <script type="text/javascript" src="${ctx}/relfile/jq/validate.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/resources/js/ajaxupload.3.6.js"></script>
    <script type="text/javascript">
      var courseid = '${courseid}'
      var userType = '${userType}'
      var user_id = '${user_id}'
      var isView = '${isView}'
      var progress = '${progress}'
      var paperDialog
      var paperGrid
      var checkDialog
      var editor
      var userDataGridObj = null
      var neweditor
      var detailEditor
      var topEditor
      var pageNo = 1
      var pageSize = 20
      var allteacher = '${course.allteacher}'
      var goBackUrl
      var dataPath = '<%=imgpath%>'
      var spocType = '${course.spoc_type}'
      var errorpagePath = '<%=errorpagePath%>'
      var paperPreview = '<%=paperPreview%>'
      var platformType = '<%=platformType%>'
      var paperAnswerUrl = '<%=paperAnswerUrl %>'
      var paperExplainUrl = '<%=paperExplainUrl %>'
      var myVideo
      var hasAllteacher = '${hasAllteacher}'
      var des_dlm = '${des_dlm}'
      var video_naviStrate = '${video_naviStrate}'
      var fvideo_control = '${video_control}' // 是否限制视频播放快进
      var thePlayer
      // 是否显示助教
      var is_assistant = '${is_assistant}'
      $(function () {
        $('#CoursewareId').addClass('current')
        if (spocType == 1) {
          if (platformType == 3) {
            $('#sourceTxt').text('★  课程来源：联盟慕课')
          } else {
            $('#sourceTxt').text('★  课程来源：人卫慕课')
          }
        } else {
          $('#sourceTxt').text('★  课程来源：本校慕课')
        }
        getDiyPage()
        if (isView != 2) {
          goBackUrl = '${ctx}/education/outline/' + courseid
        } else {
          goBackUrl = '${ctx}/education/moocaddteacher/' + courseid
        }
        if (userType == 1 || userType == 3 || userType == 2) {
          $('#returnList').show()
        } else {
          $('#returnList').hide()
        }
        if (progress == 1) {
          //从学生端个人中心的证书页链接过来请求
          goBackUrl = '${ctx}/study/credentials'
        } else if (progress == 2) {
          //公告预览
          goBackUrl = '${ctx}/education/moocaddcustom?courseid=' + courseid + '&id=' + '${noticeid}'
        }

        if (userType == 4) {
          isPermit()
        }
        //控制主观题评分是否显示
        if (is_assistant == 1) {
          $('#SubjectiveId').css('display', 'block')
        } else {
          $('#SubjectiveId').css('display', 'none')
        }
        //控制教师菜单是否显示
        if (hasAllteacher == true || hasAllteacher == 'true') {
          $('#AllTeacherId').css('display', 'block')
        } else {
          $('#AllTeacherId').css('display', 'none')
        }

        // 初始化 主观题图片上传按钮以及文档上传
        $('#imgUpload').click()
        $('#uploadAnswerUser-file').click()
        $('#loadingUpImg').hide()
        getCourseDetail(courseid)
      })

      function isPermit() {
        $.ajax({
          url: '${ctx}/study/isPermit/' + courseid,
          type: 'post',
          success: function (data) {
            if (!data.flag) {
              location.href = '${ctx}/study/go'
            }
          }
        })
      }

      function getDiyPage() {
        $.ajax({
          url: '${ctx}/study/gdp/' + courseid,
          type: 'post',
          success: function (data) {
            var str = '<ul>'
            $.each(data, function (i, item) {
              str +=
                "<li class='nav_title' style='background:url(../../../relfile/images/diy-icon1.png) no-repeat 70px center #fff;' id='diy_" +
                item.page_id +
                "' onclick='diyPageDetail(" +
                JSON2.stringify(item) +
                ")'>" +
                item.page_name +
                '</li>'
            })
            str += '</ul>'
            $('#diyPageArea').html(str)
          }
        })
      }

      function diyPageDetail(diyPage) {
        $('.nav_title').removeClass('current')
        $('.time-base').removeClass('current')
        $('#diyPageDiv').addClass('current')
        $('#diy_' + diyPage.page_id)
          .siblings()
          .css('background', 'url(../../../relfile/images/diy-icon1.png) no-repeat 70px center #fff')
        $('#diy_' + diyPage.page_id).css('background', 'url(../../../relfile/images/diy-icon1c.png) no-repeat 70px center #1f8fcf')
        $('#diyTitle').html(diyPage.page_name)
        $('#diyContent').html(diyPage.content)
      }

      var status_check = 1
      function getCourseDetail(courseid) {
        layer.closeAll('tips')
        status_check = 1
        if (isView == 1 || isView == 2) {
          status_check = 0
        } else {
          status_check = 1
        }
        $('.time-base').removeClass('current')
        $('.time-base').eq(0).addClass('current')
        var load = layer.msg('加载中，请稍后...', { icon: 16, time: 0, area: ['190px', '65px'] })
        $.ajax({
          url: '${ctx}/education/getoutline/' + courseid + '/' + status_check,
          type: 'post',
          success: function (data) {
            var records = data.records
            var str = ''
            /***********************************************循环遍历课程章**********************************************************/
            $.each(data.list, function (i, item) {
              if (spocType == 1) {
                if (item.is_sync == 0) {
                  str += "<li class='page_num_li current'><div class='page_title' style='background:#F2D4A2;'><span class='arrF'></span><h4>" + item.title + '</h4></div>'
                } else {
                  str += "<li class='page_num_li current'><div class='page_title'><span class='arrF'></span><h4>" + item.title + '</h4></div>'
                }
              } else {
                str += "<li class='page_num_li current'><div class='page_title'><span class='arrF'></span><h4>" + item.title + '</h4></div>'
              }
              str += "<ul class='page_num_con'>"
              var child = item.child
              /***********************************************循环遍历章下节**********************************************************/
              $.each(child, function (j, subitem) {
                var content = subitem.content
                if (content.length > 0) {
                  var firstitem = content[0]
                  content = content.reverse()
                  var process = subitem.process
                  var spanicon = ''
                  if (process) {
                    if (process == 1) {
                      spanicon = 'ing-page'
                    } else if (process == 2) {
                      spanicon = 'end-page'
                    }
                  }
                  str += "<li><span class='" + spanicon + "'></span><h5 style='cursor:pointer;' onclick='initContent(" + subitem.id + ',' + item.id + ")'>" + subitem.title + '</h5>'
                } else {
                  str += "<li><span class='" + spanicon + "'></span><h5>" + subitem.title + '</h5>'
                }
                if (content.length > 0) {
                  str += "<div class='page_right'>"
                  if (content.length > 15) {
                    str +=
                      "<p onclick='initContent(" +
                      subitem.id +
                      ',' +
                      item.id +
                      ")' name='" +
                      content[content.length - 1].id +
                      "' style='width:40px;float:right;padding-top:6px;cursor:pointer;'>更多</p>"
                  }
                  /***********************************************循环遍历节下单元**********************************************************/
                  $.each(content, function (k, conitem) {
                    var record_flag = conitem.courseid + '_' + conitem.outlineid + '_' + conitem.id
                    var is_study = $.inArray(record_flag, records)
                    if (is_study > -1) {
                      conitem.studyRecord = 1
                    }
                    var image = ''
                    if (conitem.type == 1) {
                      image = '${ctx}/relfile/images/i1.jpg'
                      if (conitem.studyRecord > 0) {
                        image = '${ctx}/relfile/images/course/i1_1_1.png'
                      }
                    } else if (conitem.type == 2) {
                      image = '${ctx}/relfile/images/i3.jpg'
                      if (conitem.studyRecord > 0) {
                        image = '${ctx}/relfile/images/course/i3_3_3.png'
                      }
                    } else if (conitem.type == 3) {
                      image = '${ctx}/relfile/images/i2.jpg'
                      if (conitem.studyRecord > 0) {
                        image = '${ctx}/relfile/images/course/i2_2_2.png'
                      }
                    } else if (conitem.type == 4) {
                      image = '${ctx}/relfile/images/i4.jpg'
                      if (conitem.studyRecord > 0) {
                        image = '${ctx}/relfile/images/course/i4_4_4.png'
                      }
                    } else if (conitem.type == 5) {
                      image = '${ctx}/relfile/images/i5.jpg'
                      if (conitem.studyRecord > 0) {
                        image = '${ctx}/relfile/images/course/i5_5_5.png'
                      }
                    } else if (conitem.type == 6) {
                      image = '${ctx}/relfile/images/i6.png'
                      if (conitem.studyRecord > 0) {
                        image = '${ctx}/relfile/images/course/i6_6_6.png'
                      }
                    } else if (conitem.type == 8) {
                      //主观题
                      image = '${ctx}/relfile/images/zgt/zgt_complete_n.png'
                      if (conitem.studyRecord > 0) {
                        image = '${ctx}/relfile/images/zgt/zgt_complete_c.png'
                      }
                    }
                    if (k <= 14) {
                      str +=
                        "<a  style='background:url(" +
                        image +
                        ") no-repeat;cursor:pointer;' onclick='initContent(" +
                        subitem.id +
                        ',' +
                        item.id +
                        ',' +
                        conitem.id +
                        ")' name='" +
                        conitem.id +
                        "' title='" +
                        conitem.title +
                        "'></a>"
                    }
                  })
                  str += '</div>'
                }
                str += '</li>'
              })
              str += '</ul></li>'
            })
            if (str == '') {
              str += "<div style='text-align:center;font-size:16px;color:#c0c0c0;'>暂无课程课件</div>"
            }
            $('#courseware').html(str)
            layer.close(load)
          }
        })
      }

      //公告
      function getNotice(courseid) {
        layer.closeAll('tips')
        var load = layer.msg('加载中，请稍后...', { icon: 16, time: 0, area: ['190px', '65px'] })
        $.ajax({
          url: '${ctx}/study/getnotice/' + courseid + '?progress=' + progress,
          type: 'post',
          success: function (data) {
            var str = ''
            $.each(data, function (i, item) {
              str += "<div class='det_base'><h3>" + item.title + "</h3><span class='time_open'>" + item.createtime + '</span>'
              str += '<div>' + item.content + '</div></div>'
            })
            if (str == '') {
              str += "<div style='text-align:center;font-size:16px;color:#c0c0c0;'>暂无课程公告</div>"
            }
            $('#notice').html(str)
            layer.close(load)
          }
        })
      }

      //itemid:章 subitemid:节
      function initContent(subitemid, itemid, contentid) {
        $('.time-base').removeClass('current')
        $('#spec').addClass('current')
        /* clear content first */
        clearContent()
        /* init selectbox */
        initParentSelect(0, itemid, subitemid)
        /* init contentlist */
        $.ajax({
          url: '${ctx}/education/getoutlinecontent/' + courseid + '/' + subitemid + '/' + status_check,
          type: 'post',
          success: function (contentlist) {
            var firstItem = contentlist[0]
            if (contentid != undefined && contentid != null) {
              //针对选中某一个单元课件
              $.each(contentlist, function (i, content) {
                if (content.id == contentid) {
                  firstItem = content
                  return false
                }
              })
            }
            initContentlist(firstItem, contentlist)
          }
        })
        /* save studyRecord */
      }

      function initContentlist(content, contentlist) {
        var str = ''
        var contentid = content.id
        contentlist = contentlist.reverse()
        var length = contentlist.length
        var width = 878 / length
        var handleTarget
        $.each(contentlist, function (i, item) {
          var imageUrl = ''
          var fixUrl = ''
          if (item.type == 1) {
            imageUrl = '${ctx}/relfile/images/course/bn.png'
            fixUrl = '${ctx}/relfile/images/course/bnc.png'
          } else if (item.type == 2) {
            imageUrl = '${ctx}/relfile/images/course/bn2.png'
            fixUrl = '${ctx}/relfile/images/course/bn2c.png'
          } else if (item.type == 3) {
            imageUrl = '${ctx}/relfile/images/course/bn1.png'
            fixUrl = '${ctx}/relfile/images/course/bn1c.png'
          } else if (item.type == 4) {
            imageUrl = '${ctx}/relfile/images/course/bn3.png'
            fixUrl = '${ctx}/relfile/images/course/bn3c.png'
          } else if (item.type == 5) {
            imageUrl = '${ctx}/relfile/images/course/bn4.png'
            fixUrl = '${ctx}/relfile/images/course/bn4c.png'
          } else if (item.type == 6) {
            imageUrl = '${ctx}/relfile/images/course/bn5.png'
            fixUrl = '${ctx}/relfile/images/course/bn5c.png'
          } else if (item.type == 8) {
            imageUrl = '${ctx}/relfile/images/zgt/zgt_detail_n.png'
            fixUrl = '${ctx}/relfile/images/zgt/zgt_detail_c.png'
          }
          if (contentid == item.id) {
            /* need init click event*/
            str +=
              "<li style='width:" +
              width +
              "px;float:right;' class='active'  id='li_" +
              item.id +
              "' onclick='changeContent(" +
              JSON2.stringify(item) +
              ")'><img id='ic_" +
              item.id +
              "' alt='" +
              item.type +
              "' src='" +
              fixUrl +
              "' title='" +
              item.title +
              "'/></li>"
            handleTarget = item
          } else {
            str +=
              "<li style='width:" +
              width +
              "px;float:right;' id='li_" +
              item.id +
              "'  onclick='changeContent(" +
              JSON2.stringify(item) +
              ")'><img id='ic_" +
              item.id +
              "' alt='" +
              item.type +
              "'  src='" +
              imageUrl +
              "' title='" +
              item.title +
              "'/></li>"
          }
        })
        $('#contentlist').html(str)
        changeContent(handleTarget)
      }

      function getUrl(type, isCheck) {
        var imageUrl = ''
        var fixUrl = ''
        if (type == 1) {
          imageUrl = '${ctx}/relfile/images/course/bn.png'
          fixUrl = '${ctx}/relfile/images/course/bnc.png'
        } else if (type == 2) {
          imageUrl = '${ctx}/relfile/images/course/bn2.png'
          fixUrl = '${ctx}/relfile/images/course/bn2c.png'
        } else if (type == 3) {
          imageUrl = '${ctx}/relfile/images/course/bn1.png'
          fixUrl = '${ctx}/relfile/images/course/bn1c.png'
        } else if (type == 4) {
          imageUrl = '${ctx}/relfile/images/course/bn3.png'
          fixUrl = '${ctx}/relfile/images/course/bn3c.png'
        } else if (type == 5) {
          imageUrl = '${ctx}/relfile/images/course/bn4.png'
          fixUrl = '${ctx}/relfile/images/course/bn4c.png'
        } else if (type == 6) {
          imageUrl = '${ctx}/relfile/images/course/bn5.png'
          fixUrl = '${ctx}/relfile/images/course/bn5c.png'
        } else if (type == 8) {
          imageUrl = '${ctx}/relfile/images/zgt/zgt_detail_n.png'
          fixUrl = '${ctx}/relfile/images/zgt/zgt_detail_c.png'
        }
        if (isCheck) {
          return fixUrl
        } else {
          return imageUrl
        }
      }

      function resizeCss(item) {
        var activeobj = $('#contentlist li.active').children()
        var type = activeobj.attr('alt')
        if (type) {
          var imageUrl = getUrl(type, false)
          activeobj.attr('src', imageUrl)
          var imageUrlNext = getUrl(item.type, true)
          $('#ic_' + item.id).attr('src', imageUrlNext)
        }
      }

      function initAreaForOther(item) {
        resizeCss(item)
        $('#contentlist li').removeClass('active')
        $('#contentlist li').css('background', '#eee')
        $('#li_' + item.id).addClass('active')
        $('#li_' + item.id).css('background', '#00a2e8')
        $('.vadio_list').removeClass('active')
        $('.hs').text('')
        if (item.is_sync == 0) {
          if (spocType == 1) {
            $('.hs').text('★  课程来源：本校慕课')
          }
        }
        if (item.type == 4 || item.type == 5) {
          $('#area_4').addClass('active')
        } else {
          $('#area_' + item.type).addClass('active')
        }
        layer.closeAll('tips')
        if (spocType == 1) {
          if (item.is_sync == 0) {
            $('#li_' + item.id).css('background', '#ED6942')
            layer.tips('本校慕课', '#li_' + item.id, {
              tips: [1, '#ED6942'],
              time: 0
            })
            var left = $('.layui-layer-tips').css('left')
            var fixWidth = $('#li_' + item.id).width()
            fixWidth = Math.floor(fixWidth / 2)
            $('.layui-layer-tips').css('left', parseInt(left) + fixWidth - 25 + 'px')
          }
        }
      }

      function changeContent(data) {
        initAreaForOther(data)
        $('#area_8').hide()
        switch (data.type) {
          case 1:
            initVideo(data)
            break
          case 2:
            initDocument(data)
            break
          case 3:
            initDiscuss(data)
            break
          case 4:
            initHomeWork(data)
            break
          case 5:
            initExam(data)
            break
          case 6:
            initHtml(data)
            break
          case 8:
            deadline = data.deadline
            initSubjective(data)
            break
        }
      }

      var fstudy_record = 0 // 单元学习记录
      function initVideo(data) {
        fstudy_record = data.studyRecord
        if (data.is_Collection == true) {
          $('#is_Collection').attr('src', '${ctx}/relfile/images/list/icon8-red.png') //已收藏
          $('#is_Collection').removeClass('lea-s')
        } else {
          $('#is_Collection').attr('src', '${ctx}/relfile/images/list/icon8.png') //未收藏
          $('#is_Collection').addClass('lea-s')
        }
        $('#tkArea').attr('src', data.content)
        $('#videoTitle').text(data.title)
        var videoData = { width: 790, height: 480, srtFixPath: data.fixSrtPath, fixPath: data.fixPath, title: '', imgUrl: '' }
        if (data.hasEnctyVideo == true || data.hasEnctyVideo == 'true') {
          /* videoData["CQ"] = data.chaoqing; */
          videoData['GQ'] = data.gaoqing
          videoData['BQ'] = data.biaoqing
          videoData['JS'] = data.jisu
          videoData['enc'] = 'enc'
        } else {
          videoData['enc'] = ''
        }

        var videoBulletData = ''
        var seektype = 'full'
        if (video_naviStrate == 0) {
          if (fstudy_record <= 0 || fstudy_record == undefined) {
            $.ajax({
              url: '${ctx}/education/getvbc',
              type: 'post',
              data: { course_id: data.courseid, outline_id: data.outlineid, content_id: data.id },
              dataType: 'json',
              async: false,
              success: function (video_data) {
                if (video_data.flag == true) {
                  videoBulletData = video_data.videoBulletContents
                }
              }
            })
          }
        }

        if (fvideo_control == 1 && fstudy_record <= 0) {
          seektype = 'none'
        }

        if (isChrome()) {
          $('#mediaplayer').hide()
          //初始化H5播放器
          $("#myVideo track").attr("src", data.content)
          var h5VideoBulletData = h5VideoBulletDataAdapter(videoBulletData)
          initH5Player(data, h5VideoBulletData)
        } else {
          $('#video-box').hide()
          //初始化播放器
          jwplayerSetUp('mediaplayer', data.hasEnctyVideo, true, videoData, videoBulletData, seektype)
        }

        $('#video_contentid').val(data.id)
        $('#video_outlineid').val(data.outlineid)
        if (fvideo_control == 0 && fstudy_record <= 0) {
          finishView()
        }
      }

      // 将flash播放器使用的弹题数据结构，转换成H5播放器可使用的弹题数据结构
      function h5VideoBulletDataAdapter(videoBulletData) {
        /* Flash播放器使用的弹题数据结构 */
        // 	"videoBulletContents": [
        // 		{
        // 			"answer_analysis": "2",
        // 			"content_id": 178102,
        // 			"course_id": 13393,
        // 			"createdate": 1608881933000,
        // 			"outline_id": 90283,
        // 			"question_content": "1+1=?",
        // 			"videoBulletAnswers": [
        // 				{
        // 					"answer_content": "A.1",
        // 					"answer_number": 1,
        // 					"course_id": 13393,
        // 					"createdate": 1608882168000,
        // 					"id": 2068,
        // 					"is_answer": 0,
        // 					"is_delete": 0,
        // 					"platform_type": 0,
        // 					"question_id": 1471,
        // 					"user_id": 881913
        // 				},
        // 				{
        // 					"answer_content": "B.2",
        // 					"answer_number": 1,
        // 					"course_id": 13393,
        // 					"createdate": 1608882168000,
        // 					"id": 2070,
        // 					"is_answer": 0,
        // 					"is_delete": 0,
        // 					"platform_type": 0,
        // 					"question_id": 1471,
        // 					"user_id": 881913
        // 				}
        // 			],
        // 			"video_bullet_id": 1471,
        // 			"video_play_time": "5"
        // 		}
        // 	]

        /* H5播放器使用的弹题数据结构 */
        // h5VideoBulletData: [{
        //   title: '德国位于哪个洲？', //标题
        //   type: 'radio', //选择类型：单选：radio 多选：checkbox
        //   answer: ['亚洲', '欧洲', '大洋洲'], //答案
        //   rightkey: [1], //正确答案
        //   time: '30', //秒
        //   error: true, //回答错误是否继续播放
        //   delay: true //回答错误是否回放X秒，仅仅在error为true的时候有效,若没有配置该选项，则不强制回看
        // }]
        if (!videoBulletData || videoBulletData.length == 0) {
          return // 没有弹题
        }
        var h5VideoBulletData = []
        for(var i=0;i<videoBulletData.length;i++){
          var item = videoBulletData[i]
          var answer = []
          var rightkey = []
          for(var j=0;i<item.videoBulletAnswers.length;j++){
            var ans = item.videoBulletAnswers[j]
            answer.push(ans.answer_content)
            if (ans.is_answer === 1) {
              rightkey.push(j)
            }
          }
          h5VideoBulletData.push({
            title: item.question_content, //标题
            type: rightkey.length > 1 ? 'checkbox' : 'radio', //选择类型：单选：radio 多选：checkbox
            answer: answer, //答案
            rightkey: rightkey, //正确答案
            time: item.video_play_time, //秒
            error: true, //回答错误是否继续播放
            delay: false, //回答错误是否回放X秒，仅仅在error为true的时候有效,若没有配置该选项，则不强制回看,
            analysis: item.answer_analysis // 答案分析，原flash弹题中字段，h5播放器未使用该字段
          })
        }
        return h5VideoBulletData
      }

      function finishView() {
        var outlineid = $('#video_outlineid').val()
        var contentid = $('#video_contentid').val()
        $.ajax({
          url: '${ctx}/study/saveStudyRecord/' + contentid + '/' + outlineid + '/' + courseid + '/1',
          type: 'post',
          success: function (msg) {}
        })
      }

      //收藏 ，取消收藏视频
      function favor(obj) {
        var outlineid = $('#video_outlineid').val()
        var contentid = $('#video_contentid').val()
        var check = $(obj).is('.lea-s')
        var type
        var collection_type
        if (check) {
          type = 1
        } else {
          type = 0
        }
        $.ajax({
          url: '${ctx}/web/saveFavor',
          type: 'post',
          data: {
            courseid: courseid,
            outlineid: outlineid,
            content_id: contentid,
            type: type,
            collection_type: 1,
            platformType: platformType
          },
          success: function (data) {
            if (data.flag) {
              if (type == 1) {
                $(obj).removeClass('lea-s')
                $('#is_Collection').attr('src', '${ctx}/relfile/images/list/icon8-red.png') //已收藏
                layer.msg('收藏成功')
              } else {
                $(obj).addClass('lea-s')
                $('#is_Collection').attr('src', '${ctx}/relfile/images/list/icon8.png') //未收藏
                layer.msg('取消收藏成功')
              }
            } else {
              layer.msg('收藏失败')
            }
          }
        })
      }

      function initHtml(data) {
        $.ajax({
          url: '${ctx}/study/saveStudyRecord/' + data.id + '/' + data.outlineid + '/' + courseid + '/' + data.type,
          type: 'post',
          success: function (msg) {
            $('#htmlDiv').html(data.content)
            $('#htmlTitle').html(data.title)
          }
        })
        /* $("#htmlDiv").html(data.content);
      $("#htmlTitle").html(data.title); */
      }

      function initDocument(data) {
        $('#dataTitle').text('')
        $('#dataTitle').text(data.title)
        $('#frameD').attr('src', dataPath + data.path)
        $.ajax({
          url: '${ctx}/study/saveStudyRecord/' + data.id + '/' + data.outlineid + '/' + courseid + '/' + data.type,
          type: 'post',
          success: function (msg) {
            if (msg.flag) {
            }
          }
        })
      }

      var f_contentid
      var f_parentUserName
      function initDiscuss(data) {
        var contentId = data.contentid
        $('#discussTitle').text('')
        $('#discussContent').html('')
        $('#discussInnerTitle').text('')
        $('#discussInnerTitle').text(data.title)
        $('#topic_id').val(data.contentid)
        var doc = document.getElementById('myDiscuss')
        checkMaxInput(doc, 800)
        /* editor = UE.getEditor('myDiscuss',{
      	initialFrameHeight:300,
      	autoHeightEnabled:false,
      	elementPathEnabled : false,
      	autoFloatEnabled:false,
      	enableAutoSave:false,
      	toolbars:[[ 'undo', 'redo', '|','bold', 'italic', 'underline','|','removeformat','|', 'justifyleft', 'justifycenter', 'justifyright','|']]
      }); */
        $.ajax({
          url: '${ctx}/study/gdtbc/' + contentId,
          type: 'post',
          success: function (datas) {
            if (datas.fixPhoto == undefined || datas.fixPhoto == '') {
              datas.fixPhoto = '${ctx}/resources/images/header_default.png'
            }
            $('#talkUserPhoto').attr('src', datas.fixPhoto)
            $('#talkUser').text(datas.name)
            $('#talkUserTime').text('发表于   ' + datas.diff)
            $('#discussTitle').text(datas.title)
            $('#discussContent').html(datas.content)
            f_contentid = contentId
            f_parentUserName = datas.name
            getDiscuss(contentId, datas.name)
          }
        })
      }

      var page_No = 1
      var page_Size = 10
      function getDiscuss(contentid, parentUserName) {
        $('#dd_discussPageNo').val(page_No)
        $.ajax({
          url: '${ctx}/study/grbcpage/' + contentid + '/0?pageNo=' + page_No + '&pageSize=' + page_Size + '&is_all=1',
          type: 'post',
          success: function (data) {
            var str = ''
            $.each(data.row, function (i, item) {
              if (item.fixPhoto == undefined || item.fixPhoto == '') {
                item.fixPhoto = '${ctx}/resources/images/header_default.png'
              }
              if (item.name == undefined || item.name == '') {
                if (item.truename != undefined) {
                  item.name = item.truename
                } else {
                  item.name = ''
                }
              }
              str += "<div class='each_talk_list' >"
              str +=
                "<div><span style='float:left;margin-left:-15px;'><img src='" +
                item.fixPhoto +
                "' style='width:24px;height:24px;'/></span><span style='float:left;padding-left:10px;'><span style='font-weight:bold;'>" +
                item.name +
                "</span> 回复：<span style='color:#1f8fcf;'>" +
                parentUserName +
                '<span></span></div>'
              str += "<div style='padding-left:15px;clear: both;'>" + item.content + '</div>'
              str += "<div class='forum_B'><span class='numb0' style='font-size:6px;color:#999;margin-left:4px;'>发表于   " + item.diff + '</span>'
              str +=
                "<span style='margin-right:0px;float:right;cursor:pointer;' id='chf_" +
                item.topic_id +
                "' class='numb3' onclick='startSingleTalk(" +
                JSON2.stringify(item) +
                ',0,"' +
                item.name +
                "\");'>收起回复</span><span class='numb1' style='margin-right:30px;float:right;'>" +
                item.createtime +
                '</span></div>'
              var ctr = ''
              ctr += "<div class='clear'></div><div class='hf' id='crp_" + item.topic_id + "'><div class='none'></div><div class='dthf'><ul id='culsp_" + item.topic_id + "'>"
              if (item.replyCount > 0) {
                $.ajax({
                  url: '${ctx}/study/grbc/' + item.topic_id,
                  type: 'post',
                  async: false,
                  success: function (data) {
                    $.each(data, function (i, subitem) {
                      if (subitem.fixPhoto == undefined || subitem.fixPhoto == '') {
                        subitem.fixPhoto = '${ctx}/resources/images/header_default.png'
                      }
                      if (subitem.name == undefined || subitem.name == '') {
                        if (subitem.truename != undefined) {
                          subitem.name = subitem.truename
                        } else {
                          subitem.name = ''
                        }
                      }
                      ctr +=
                        "<li><div style='float:left;padding-top:10px;'><img src='" +
                        subitem.fixPhoto +
                        "' style='float:left;width:24px;height:24px;'/><a href='#' style='padding-left:10px;'>" +
                        subitem.name +
                        '</a></div>'
                      ctr += "<div style='clear:both;font-size: 6px;'><span>" + subitem.content + '</span></div>'
                      ctr +=
                        "<div class='rq'><span style='font-size:6px;'>发表于  " +
                        subitem.diff +
                        "</span><a href='javascript:void(0);' style='cursor:pointer;' onclick='willTalk(" +
                        JSON2.stringify(item) +
                        ',1,"' +
                        subitem.name +
                        '");\'>回复</a></div></li>'
                    })
                  }
                })
              }
              ctr +=
                "</ul></div><div style='height:50px;position:relative;'><a href='javascript:void(0);'  style='right:20px;top:5px;border:1px solid #ccc;padding:0px 10px;border-radius:4px;position:absolute;cursor:pointer;' onclick='willTalk(" +
                JSON2.stringify(item) +
                ",0);'>我也说一句</a></div></div>"
              str += ctr
              str += '</div>'
            })
            $('#replylist').html(str)

            if (data.totalPage == 0) {
              $('#discuss_detail_page').css('display', 'none')
              page_No = 0
            } else {
              $('#discuss_detail_page').css('display', 'block')
              if (data.pageNo >= data.totalPage) {
                page_No = data.totalPage
              } else {
                page_No = data.pageNo
              }
            }
            $('#dd_pageCenter').text('第' + page_No + '页/共' + data.totalPage + '页')
            $('#dd_discussTotalPage').val(data.totalPage)
            f_fenyeCSS(data, '#dd_pageCenter', '#dd_shouyeG', '#dd_shangyiyeG', '#dd_xiayiyeG', '#dd_moyeG')
          }
        })
      }

      function f_fenyeCSS(data, count, shouye, shangyiye, xiayiye, moye) {
        if (data.totalPage > 1) {
          $(count).css('color', '#2883BC')
        } else {
          $(count).css('color', '#c0c0c0')
        }
        if (data.pageNo >= 1) {
          //当前页码>=1
          if (data.pageNo == 1) {
            //当前页码等于0
            if (data.pageNo == data.totalPage) {
              //当前页码等于总页数
              $('.page1 span').removeClass('color2')
              $('.page1 span').addClass('color1')
            } else if (data.pageNo < data.totalPage) {
              //当前页码小于总页数
              $(shouye).removeClass('color2')
              $(shangyiye).removeClass('color2')
              $(xiayiye).removeClass('color1')
              $(moye).removeClass('color1')
              $(shouye).addClass('color1')
              $(shangyiye).addClass('color1')
              $(xiayiye).addClass('color2')
              $(moye).addClass('color2')
            }
          } else if (data.pageNo > 1) {
            //当前页码大于1
            if (data.pageNo == data.totalPage) {
              //当前页码大于1且等于总页数
              $(shouye).removeClass('color1')
              $(shangyiye).removeClass('color1')
              $(xiayiye).removeClass('color2')
              $(moye).removeClass('color2')
              $(shouye).addClass('color2')
              $(shangyiye).addClass('color2')
              $(xiayiye).addClass('color1')
              $(moye).addClass('color1')
            } else if (data.pageNo < data.totalPage) {
              //当前页码大于1且小于总页数
              $('.page1 span').removeClass('color1')
              $('.page1 span').addClass('color2')
            }
          }
        } else {
          //当前页码<1,也就是等于0
          $('.page1 span').removeClass('color2')
          $('.page1 span').addClass('color1')
        }
      }

      function dd_changeNo(type) {
        switch (type) {
          case -1:
            page_No = 1
            getDiscuss(f_contentid, f_parentUserName)
            break
          case 1:
            var hiddenNo = $('#dd_discussPageNo').val()
            page_No = parseInt(hiddenNo) - 1
            if (page_No <= 1) {
              page_No = 1
            }
            getDiscuss(f_contentid, f_parentUserName)
            break
          case 2:
            var hiddenTotalPage = $('#dd_discussTotalPage').val()
            var hiddenNo = $('#dd_discussPageNo').val()
            page_No = parseInt(hiddenNo) + 1
            if (page_No == hiddenTotalPage) {
              page_No = hiddenTotalPage
            }
            getDiscuss(f_contentid, f_parentUserName)
            break
          case -2:
            page_No = $('#dd_discussTotalPage').val()
            getDiscuss(f_contentid, f_parentUserName)
            break
          case 0:
            page_No = $('#tiaozhuan2').val()
            getDiscuss(f_contentid, f_parentUserName)
            break
        }
      }

      function getReplyForReply(targetTalk, type) {
        $.ajax({
          url: '${ctx}/study/grbc/' + targetTalk.topic_id,
          type: 'post',
          async: false,
          success: function (data) {
            var str = ''
            $.each(data, function (i, subitem) {
              if (subitem.fixPhoto == undefined || subitem.fixPhoto == '') {
                subitem.fixPhoto = '${ctx}/resources/images/header_default.png'
              }
              str +=
                "<li><div style='float:left;padding-top:10px;'><img src='" +
                subitem.fixPhoto +
                "' style='float:left;width:24px;height:24px;'/><a href='#' style='padding-left:10px;'>" +
                subitem.name +
                '</a></div>'
              str += "<div style='clear:both;font-size: 6px;'><span>" + subitem.content + '</span></div>'
              str +=
                "<div class='rq'><span>发表于  " +
                subitem.diff +
                "</span><a href='javascript:void(0);' style='cursor:pointer;' onclick='willTalk(" +
                JSON2.stringify(targetTalk) +
                ',' +
                type +
                ',"' +
                subitem.name +
                '");\'>回复</a></div></li>'
            })
            if (type == 0) {
              $('#culsp_' + targetTalk.topic_id).html(str)
            } else {
              $('#ulsp_' + targetTalk.topic_id).html(str)
            }
          }
        })
      }

      function willTalk(targetTalk, type, name) {
        if (!name) {
          name = ''
        } else {
          name = '@' + name + '：'
        }
        if (type == 1) {
          var talkArea =
            "<div id='add_" +
            targetTalk.topic_id +
            "'style='margin-bottom:55px;padding:2px 10px;' class='addsp'><textarea id='topTalkArea_" +
            targetTalk.topic_id +
            "' style='width: 100%;border:1px solid #999;resize:none;'></textarea><button style='background:#1f8fcf;color:#fff;font-size:15px;width:100px;height:36px;cursor:pointer;bottom:10px;right:20px;position:absolute;z-index:999;' onclick='saveTopTalk(" +
            JSON2.stringify(targetTalk) +
            ',' +
            type +
            ");'>保存</button></div>"
          var isExists = $('#rp_' + targetTalk.topic_id)
            .children()
            .hasClass('addsp')
          if (!isExists) {
            $('#rp_' + targetTalk.topic_id).append(talkArea)
          } else {
            $('#rp_' + targetTalk.topic_id)
              .find('.addsp')
              .remove()
          }
          $('#topTalkArea_' + targetTalk.topic_id).val(name)
        } else {
          var talkArea =
            "<div id='cadd_" +
            targetTalk.topic_id +
            "'style='margin-bottom:55px;padding:2px 10px;' class='caddsp'><textarea id='ctopTalkArea_" +
            targetTalk.topic_id +
            "' style='width: 100%;border:1px solid #999;resize:none;'></textarea><button style='background:#1f8fcf;color:#fff;font-size:15px;width:100px;height:36px;cursor:pointer;bottom:10px;right:20px;position:absolute;z-index:999;' onclick='saveTopTalk(" +
            JSON2.stringify(targetTalk) +
            ',' +
            type +
            ");'>保存</button></div>"
          var isExists = $('#crp_' + targetTalk.topic_id)
            .children()
            .hasClass('caddsp')
          if (!isExists) {
            $('#crp_' + targetTalk.topic_id).append(talkArea)
          } else {
            $('#crp_' + targetTalk.topic_id)
              .find('.caddsp')
              .remove()
          }
          $('#ctopTalkArea_' + targetTalk.topic_id).val(name)
        }
        $('#top_parent_id').val(targetTalk.topic_id)
        $('#top_is_content').val(targetTalk.is_content)
        $('#top_type').val(type)
        $('#top_title').val('@' + name)
      }

      function startSingleTalk(targetTalk, type, name) {
        if (type == 1) {
          var talkArea =
            "<div id='add_" +
            targetTalk.topic_id +
            "'style='margin-bottom:55px;padding:2px 10px;' class='addsp'><textarea id='topTalkArea_" +
            targetTalk.topic_id +
            "' style='width: 100%;border:1px solid #999;resize:none;'></textarea><button style='background:#1f8fcf;color:#fff;font-size:15px;width:100px;height:36px;cursor:pointer;bottom:10px;right:20px;position:absolute;z-index:999;' onclick='saveTopTalk(" +
            JSON2.stringify(targetTalk) +
            ',' +
            type +
            ");'>保存</button></div>"
          var isExists = $('#rp_' + targetTalk.topic_id)
            .children()
            .hasClass('addsp')
          if (!isExists) {
            $('#rp_' + targetTalk.topic_id).append(talkArea)
          } else {
            $('#rp_' + targetTalk.topic_id)
              .find('.addsp')
              .remove()
          }
          var isShow = $('#rp_' + targetTalk.topic_id).is(':visible')
          var replyCount = $('#rp_' + targetTalk.topic_id + ' ul').find('li').length
          if (isShow) {
            $('#hf_' + targetTalk.topic_id).removeClass('numb3')
            $('#hf_' + targetTalk.topic_id).text('回复（' + replyCount + '）')
          } else {
            $('#hf_' + targetTalk.topic_id).addClass('numb3')
            $('#hf_' + targetTalk.topic_id).text('收起回复')
          }
          $('#rp_' + targetTalk.topic_id).slideToggle(300)
          $('#topTalkArea_' + targetTalk.topic_id).val('@' + name + '：')
        } else {
          var talkArea =
            "<div id='cadd_" +
            targetTalk.topic_id +
            "'style='margin-bottom:55px;padding:2px 10px;' class='caddsp'><textarea id='ctopTalkArea_" +
            targetTalk.topic_id +
            "' style='width: 100%;border:1px solid #999;resize:none;'></textarea><button style='background:#1f8fcf;color:#fff;font-size:15px;width:100px;height:36px;cursor:pointer;bottom:10px;right:20px;position:absolute;z-index:999;' onclick='saveTopTalk(" +
            JSON2.stringify(targetTalk) +
            ',' +
            type +
            ");'>保存</button></div>"
          var isExists = $('#crp_' + targetTalk.topic_id)
            .children()
            .hasClass('caddsp')
          if (!isExists) {
            $('#crp_' + targetTalk.topic_id).append(talkArea)
          } else {
            $('#crp_' + targetTalk.topic_id)
              .find('.caddsp')
              .remove()
          }
          var isShow = $('#crp_' + targetTalk.topic_id).is(':visible')
          var replyCount = $('#crp_' + targetTalk.topic_id + ' ul').find('li').length
          if (isShow) {
            $('#chf_' + targetTalk.topic_id).removeClass('numb3')
            $('#chf_' + targetTalk.topic_id).text('回复（' + replyCount + '）')
          } else {
            $('#chf_' + targetTalk.topic_id).addClass('numb3')
            $('#chf_' + targetTalk.topic_id).text('收起回复')
          }
          $('#crp_' + targetTalk.topic_id).slideToggle(300)
          $('#ctopTalkArea_' + targetTalk.topic_id).val('@' + name + ':')
        }
        $('#top_parent_id').val(targetTalk.topic_id)
        $('#top_is_content').val(targetTalk.is_content)
        $('#top_type').val(type)
        $('#top_title').val('@' + name)
      }

      function saveTopTalk(targetTalk, type) {
        var talkTopTopicId = $('#topic_id').val()
        var topContent = ''
        if (type == 1) {
          topContent = $('#topTalkArea_' + targetTalk.topic_id).val()
        } else {
          topContent = $('#ctopTalkArea_' + targetTalk.topic_id).val()
        }
        if (!isNotBlank(topContent)) {
          layer.alert('讨论内容不允许为空!', { icon: 0, title: '提示' })
          return
        }
        $('#topContent').val(topContent)
        var talkTopTitle = $('#discussInnerTitle').text()
        $('#topForm').ajaxSubmit({
          type: 'post',
          url: '${ctx}/study/savediscuss',
          dataType: 'json',
          data: {
            talkTopTitle: talkTopTitle,
            talkTopTopicId: talkTopTopicId
          },
          success: function (data) {
            if (data.flag) {
              if (type == 1) {
                $('#rp_' + targetTalk.topic_id)
                  .find('.addsp')
                  .remove()
              } else {
                $('#crp_' + targetTalk.topic_id)
                  .find('.caddsp')
                  .remove()
              }
              getReplyForReply(targetTalk, type)
            } else {
              layer.alert(data.msg, { icon: 2, title: '提示' })
            }
          }
        })
      }

      function closeSingleTalk() {
        $('.page').fadeToggle(200)
      }

      function f_showPageDetail(data, id, showType, is_read) {
        if (showType == 1) {
          $('#showWorks').html('作业解析')
        } else {
          $('#showWorks').html('考试解析')
        }
        $('.time-base').removeClass('current')
        $('#infoPageArea').addClass('current')
        $('#infoPageTarget').attr('src', paperExplainUrl + '?paper_id=' + id + '&user_id=' + user_id + des_dlm)
      }

      //初始化试卷包中试卷列表弹出框
      function initPaperDialog(type, packageId, data, showType, is_read) {
        paperDialog = $('#paperDialog').dialog({
          title: '选择内容',
          width: 700,
          height: 400,
          closed: false,
          cache: false,
          modal: true,
          buttons: [
            {
              text: '预览',
              handler: function () {
                var rows = $('#paperGrid').datagrid('getSelections')
                if (rows.length != 1) {
                  layer.alert('请选择一条记录!', { icon: 0, title: '提示' })
                  return
                } else {
                  var paperid = rows[0].ID
                  f_showPageDetail(data, paperid, showType, is_read)
                  //f_viewContent(type,paperid);
                  $('#paperDialog').dialog('close')
                }
              }
            },
            {
              text: '关闭',
              handler: function () {
                $('#paperDialog').dialog('close')
              }
            }
          ]
        })
        initPaperGrid(type, packageId)
        $('#paperDialog').dialog('open')
      }

      function initPaperGrid(type, packageId, paperName) {
        var paperName = $('#paperName').val()
        if (paperName == '试卷名称' || paperName == '' || paperName == undefined) {
          paperName = ''
        }
        paperGrid = $('#paperGrid').datagrid({
          nowrap: false, //设置为true，当数据长度超出列宽时将会自动截取
          striped: true, //设置为true将交替显示行背景。
          collapsible: false, //显示可折叠按钮
          url: '${ctx}/study/gtpl/' + courseid + '/' + type + '/1', //url调用Action方法
          queryParams: { papername: paperName, packageId: packageId },
          columns: [
            [
              { field: 'ID', title: 'ID', width: 50 },
              { field: 'NAME', title: '试卷名称', width: 200 },
              { field: 'ADDTIME', title: '创建时间', width: 100, align: 'center' },
              { field: 'VALIDITYDATE', title: '有效日期', width: 100, align: 'center' },
              { field: 'DESCRIPTION', title: '描述', width: 180 }
            ]
          ],
          loadMsg: '数据装载中......',
          singleSelect: true, //为true时只能选择单行
          fitColumns: false, //允许表格自动缩放，以适应父容器
          idField: 'id',
          remoteSort: false,
          checkOnSelect: true,
          pagination: true, //分页
          rownumbers: true, //行数
          pageSize: 10, //每页显示的记录条数，默认为15?
          pageList: [10, 15, 20, 30], //可以设置每页记录条数的列表
          onLoadSuccess: function (row) {
            $(this).datagrid('clearSelections')
          }
        })
      }

      //条件检索
      function f_selectPaper() {
        var paperName = $('#paperName').val()
        var type = $('#paperSeachType').val()
        var packageId = $('#pagerOrPackage').val()
        initPaperGrid(type, packageId, paperName)
      }

      //初始化作业练习
      function initHomeWork(data) {
        if (data.contentid != undefined) {
          if (isView == 1) {
            //预览课件，把试卷上的答题按钮都隐藏
            // $('#frameH').attr('src', paperPreview + '?paper_id=' + data.contentid + '&PaperOrPackage=' + data.pager_type + des_dlm)
            let iframeWorkUrl0 = paperPreview + '?paper_id=' + data.contentid + '&PaperOrPackage=' + data.pager_type + des_dlm;
            $('#frameH').attr('src', iframeWorkUrl0);
            window.open(iframeWorkUrl0, '_blank');
          } else {
            $.ajax({
              //验证答题截止日期是否有效
              url: '${ctx}/study/checkDeadLine/' + data.id + '/' + data.contentid,
              type: 'post',
              dataType: 'json',
              success: function (datas) {
                $.ajax({
                  url: '${ctx}/study/gm/' + data.id + '/' + courseid,
                  type: 'post',
                  dataType: 'json',
                  success: function (msg) {
                    if (datas.flag == true) {
                      $('#examTitle').text('')
                      $('#examTitle').text(data.title)
                      var domain = msg.domain
                      if (domain) {
                        domain = 'http://' + domain + '/'
                      }
                      if (msg.flag === true) {
                        let iframeWorkUrl1 = paperAnswerUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&des_deadline=' + data.des_deadline + '&domain=' + domain + '&PaperOrPackage=' + data.pager_type + des_dlm
                        $('#frameH').attr( 'src', iframeWorkUrl1);
                        window.open(iframeWorkUrl1, '_blank' );
                        // $('#frameH').attr(
                        //   'src',
                        //   paperAnswerUrl +
                        //     '?paper_id=' +
                        //     data.contentid +
                        //     '&user_id=' +
                        //     user_id +
                        //     '&des_deadline=' +
                        //     data.des_deadline +
                        //     '&domain=' +
                        //     domain +
                        //     '&PaperOrPackage=' +
                        //     data.pager_type +
                        //     des_dlm
                        // )
                      } else if (msg.flag == false) {
                        if (data.pager_type != '' && data.pager_type != undefined && data.pager_type == 1) {
                          layer.confirm(
                            '当前试卷为试卷包且包含多份试卷，请选择以下操作继续！',
                            {
                              btn: ['继续答题', '查看解析'] //按钮
                            },
                            function (index) {
                              layer.close(index)
                              let iframeWorkUrl2 = paperAnswerUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&des_deadline=' + data.des_deadline + '&domain=' + domain + '&PaperOrPackage=' + data.pager_type + des_dlm
                              $('#frameH').attr( 'src', iframeWorkUrl2);
                              window.open(iframeWorkUrl2, '_blank' );
                              // $('#frameH').attr(
                              //   'src',
                              //   paperAnswerUrl +
                              //     '?paper_id=' +
                              //     data.contentid +
                              //     '&user_id=' +
                              //     user_id +
                              //     '&des_deadline=' +
                              //     data.des_deadline +
                              //     '&domain=' +
                              //     domain +
                              //     '&PaperOrPackage=' +
                              //     data.pager_type +
                              //     des_dlm
                              // )
                            },
                            function (index) {
                              layer.close(index)
                              let iframeWorkUrl3 =  paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm
                              $('#frameH').attr('src', iframeWorkUrl3);
                              window.open(iframeWorkUrl3, '_blank' );
                              // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm)
                            }
                          )
                        } else {
                          let iframeWorkUrl4 = paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm;
                          $('#frameH').attr('src', iframeWorkUrl4);
                          window.open(iframeWorkUrl4, '_blank' );
                          // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm)
                        }
                      } else {
                        layer.alert('网络异常，请重试！', { icon: 2, title: '提示' })
                      }
                    } else {
                      if (msg.flag == false) {
                        $('#examTitle').text('')
                        $('#examTitle').text(data.title)
                        if (data.pager_type != '' && data.pager_type != undefined && data.pager_type == 1) {
                          let iframeWorkUrl5 = paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm;
                          $('#frameH').attr('src', iframeWorkUrl5);
                          window.open(iframeWorkUrl5, '_blank' );
                          // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm)
                        } else {
                          let iframeWorkUrl6 = paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm;
                          $('#frameH').attr('src', iframeWorkUrl6);
                          window.open(iframeWorkUrl6, '_blank');
                          // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm)
                        }
                      } else {
                        layer.alert('作业/试卷答题截止时间已过期，无法继续答题!', { icon: 2, title: '提示' })
                      }
                    }
                  }
                })
              }
            })
          }
        } else {
          layer.alert('试卷ID不存在', { icon: 0, title: '提示' })
          return
        }
      }

      //初始化试卷
      function initExam(data) {
        if (data.contentid != undefined) {
          if (isView == 1) {
            //预览课件，把试卷上的答题按钮都隐藏
            let iframeWorkUrl0 = paperPreview + '?paper_id=' + data.contentid + '&PaperOrPackage=' + data.pager_type + des_dlm;
            $('#frameH').attr('src', iframeWorkUrl0);
            window.open(iframeWorkUrl0, '_blank')
            // $('#frameH').attr('src', paperPreview + '?paper_id=' + data.contentid + '&PaperOrPackage=' + data.pager_type + des_dlm)
          } else {
            $.ajax({
              url: '${ctx}/study/checkDeadLine/' + data.id + '/' + data.contentid,
              type: 'post',
              dataType: 'json',
              success: function (datas) {
                $.ajax({
                  url: '${ctx}/study/gm/' + data.id + '/' + courseid,
                  type: 'post',
                  dataType: 'json',
                  success: function (msg) {
                    if (datas.flag == true) {
                      $('#examTitle').text('')
                      $('#examTitle').text(data.title)
                      var domain = msg.domain
                      if (domain) {
                        domain = 'http://' + domain + '/'
                      }
                      if (msg.flag == true) {
                        let iframeWorkUrl1 = paperAnswerUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&des_deadline=' + data.des_deadline + '&domain=' + domain + '&PaperOrPackage=' + data.pager_type + des_dlm
                        $('#frameH').attr( 'src', iframeWorkUrl1);
                        window.open(iframeWorkUrl1, '_blank');
                        // $('#frameH').attr(
                        //   'src',
                        //   paperAnswerUrl +
                        //     '?paper_id=' +
                        //     data.contentid +
                        //     '&user_id=' +
                        //     user_id +
                        //     '&des_deadline=' +
                        //     data.des_deadline +
                        //     '&domain=' +
                        //     domain +
                        //     '&PaperOrPackage=' +
                        //     data.pager_type +
                        //     des_dlm
                        // )
                      } else {
                        if (data.pager_type != '' && data.pager_type != undefined && data.pager_type == 1) {
                          layer.confirm(
                            '当前试卷为试卷包且包含多份试卷，请选择以下操作继续！',
                            {
                              btn: ['继续答题', '查看解析'] //按钮
                            },
                            function (index) {
                              layer.close(index)
                              let iframeWorkUrl2 = paperAnswerUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&des_deadline=' + data.des_deadline + '&domain=' + domain + '&PaperOrPackage=' + data.pager_type + des_dlm;
                              $('#frameH').attr( 'src', iframeWorkUrl2);
                              window.open(iframeWorkUrl2, '_blank');
                              // $('#frameH').attr(
                              //   'src',
                              //   paperAnswerUrl +
                              //     '?paper_id=' +
                              //     data.contentid +
                              //     '&user_id=' +
                              //     user_id +
                              //     '&des_deadline=' +
                              //     data.des_deadline +
                              //     '&domain=' +
                              //     domain +
                              //     '&PaperOrPackage=' +
                              //     data.pager_type +
                              //     des_dlm
                              // )
                            },
                            function (index) {
                              layer.close(index)
                              let iframeWorkUrl3 = paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm;
                              $('#frameH').attr('src', iframeWorkUrl3);
                              window.open(iframeWorkUrl3, '_blank');
                              // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm)
                            }
                          )
                        } else {
                          let iframeWokUrl4 = paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm;
                          $('#frameH').attr('src', iframeWokUrl4);
                          window.open(iframeWokUrl4, '_blank');
                          // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm)
                        }
                      }
                    } else {
                      if (msg.flag == false) {
                        $('#examTitle').text('')
                        $('#examTitle').text(data.title)
                        if (data.pager_type != '' && data.pager_type != undefined && data.pager_type == 1) {
                          let iframeWorkUrl5 = paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm;
                          $('#frameH').attr('src', iframeWorkUrl5);
                          window.open(iframeWorkUrl5, '_blank');
                          // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + '&PaperOrPackage=' + data.pager_type + des_dlm)
                        } else {
                          let iframeWorkUrl6 = paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm;
                          $('#frameH').attr('src', iframeWorkUrl6);
                          window.open(iframeWorkUrl6, '_blank');
                          // $('#frameH').attr('src', paperExplainUrl + '?paper_id=' + data.contentid + '&user_id=' + user_id + des_dlm)
                        }
                      } else {
                        layer.alert('作业/试卷答题截止时间已过期，无法继续答题!', { icon: 2, title: '提示' })
                      }
                    }
                  }
                })
              }
            })
          }
        } else {
          layer.alert('试卷ID不存在', { icon: 0, title: '提示' })
          return
        }
      }

      function clearContent() {
        $('.vadio_list').removeClass('active')
        //$("#videoArea").attr("src","");
        $('#mediaplayer').html('')
        $('#dataTitle').text('')
        $('#examTitle').text('')
        $('#discussTitle').text('')
        $('#discussContent').html('')
        $('#discussInnerTitle').text('')
      }
      function initParentSelect(parentid, itemid, subitemid) {
        $.ajax({
          url: '${ctx}/study/getselectforoutline/' + isView + '/' + courseid + '/' + parentid,
          type: 'post',
          success: function (data) {
            var str = ''
            $.each(data, function (i, item) {
              if (item.id == itemid) {
                str += "<option selected='selected' value='" + item.id + "'>" + item.title + '</option>'
              } else {
                str += "<option value='" + item.id + "'>" + item.title + '</option>'
              }
            })
            $('#parentselect').html(str)
          }
        })
        changeItem(itemid, subitemid)
      }

      //parentid 第一个下拉框值 subitemid 第二个下拉框值
      function changeItem(parentid, subitemid) {
        $.ajax({
          url: '${ctx}/study/getselectforoutline/' + isView + '/' + courseid + '/' + parentid,
          type: 'post',
          success: function (data) {
            var str = ''
            if (!subitemid) {
              clearContent()
            }
            $.each(data, function (i, item) {
              if (item.id == subitemid) {
                str += "<option selected='selected' value='" + item.id + "'>" + item.title + '</option>'
              } else {
                str += "<option value='" + item.id + "'>" + item.title + '</option>'
              }
            })
            $('#subselect').html(str)
            if (!subitemid) {
              changeSubItem($('#subselect').val())
            }
          }
        })
      }

      function changeSubItem(value) {
        if (!value) {
          $('#contentlist').html('')
          return
        }
        $.ajax({
          url: '${ctx}/study/gclfo/' + courseid + '/' + value,
          type: 'post',
          success: function (contentlist) {
            var str = ''
            clearContent()
            var length = contentlist.length
            var width = 878 / length
            var handleTarget
            $.each(contentlist, function (i, item) {
              var imageUrl = ''
              var fixUrl = ''
              if (item.type == 1) {
                imageUrl = '${ctx}/relfile/images/course/bn.png'
                fixUrl = '${ctx}/relfile/images/course/bnc.png'
              } else if (item.type == 2) {
                imageUrl = '${ctx}/relfile/images/course/bn2.png'
                fixUrl = '${ctx}/relfile/images/course/bn2c.png'
              } else if (item.type == 3) {
                imageUrl = '${ctx}/relfile/images/course/bn1.png'
                fixUrl = '${ctx}/relfile/images/course/bn1c.png'
              } else if (item.type == 4) {
                imageUrl = '${ctx}/relfile/images/course/bn3.png'
                fixUrl = '${ctx}/relfile/images/course/bn3c.png'
              } else if (item.type == 5) {
                imageUrl = '${ctx}/relfile/images/course/bn4.png'
                fixUrl = '${ctx}/relfile/images/course/bn4c.png'
              } else if (item.type == 6) {
                imageUrl = '${ctx}/relfile/images/course/bn5.png'
                fixUrl = '${ctx}/relfile/images/course/bn5c.png'
              } else if (item.type == 8) {
                imageUrl = '${ctx}/relfile/images/zgt/zgt_detail_n.png'
                fixUrl = '${ctx}/relfile/images/zgt/zgt_detail_c.png'
              }
              if (i == 0) {
                handleTarget = item
                str +=
                  "<li style='width:" +
                  width +
                  "px; float:left;' class='active' id='li_" +
                  item.id +
                  "' onclick='changeContent(" +
                  JSON2.stringify(item) +
                  ")'><img id='ic_" +
                  item.id +
                  "' alt='" +
                  item.type +
                  "' src='" +
                  fixUrl +
                  "'/></li>"
              } else {
                str +=
                  "<li style='width:" +
                  width +
                  "px;float:left;' id='li_" +
                  item.id +
                  "' onclick='changeContent(" +
                  JSON2.stringify(item) +
                  ")'><img id='ic_" +
                  item.id +
                  "' alt='" +
                  item.type +
                  "' src='" +
                  imageUrl +
                  "'/></li>"
              }
            })
            $('#contentlist').html(str)
            changeContent(handleTarget)
          }
        })
      }

      function saveDiscuss() {
        var contentid = $('#topic_id').val()
        var parentUserName = $('#talkUser').html()
        var discussContent = $('#myDiscuss').val()
        // var discussContent = editor.getContent();
        if (!isNotBlank(discussContent)) {
          layer.alert('讨论内容不允许为空!', { icon: 0, title: '提示' })
          return
        }
        $('#content').val(discussContent)
        var talkTopTitle = $('#discussInnerTitle').text()
        $('#discussForm').ajaxSubmit({
          type: 'post',
          url: '${ctx}/study/savediscuss',
          data: {
            talkTopTitle: talkTopTitle,
            talkTopTopicId: contentid
          },
          dataType: 'json',
          success: function (data) {
            if (data.flag) {
              $('#myDiscuss').val('')
              var doc = document.getElementById('myDiscuss')
              checkMaxInput(doc, 800)
              getDiscuss(contentid, parentUserName)
            } else {
              layer.alert(data.msg, { icon: 2, title: '提示' })
            }
          }
        })
      }

      function goHome() {
        window.location = goBackUrl
      }

      var studentDialog
      var lay_data
      var lay_id
      var lay_showType
      function goToPage(data, id, showType, is_read) {
        lay_data = data
        lay_id = id
        lay_showType = showType
        layer_Dialog('选择操作', 'goToPageDlg', false, 1, '450', '300')
      }

      function checkToPage() {
        var checkedVal = $(':radio:checked').val() //单选按钮选中值
        if (checkedVal == 0) {
          //查看解析
          if (lay_showType == 1) {
            $('#showWorks').html('作业解析')
          } else {
            $('#showWorks').html('考试解析')
          }
          $('.time-base').removeClass('current')
          $('#infoPageArea').addClass('current')
          $('#infoPageTarget').attr('src', paperExplainUrl + '?paper_id=' + lay_id + '&user_id=' + user_id + des_dlm)
          layer.closeAll()
        } else if (checkedVal == 1) {
          //继续作答
          $.ajax({
            url: '${ctx}/study/checkDeadLine/' + lay_data.id + '/' + lay_data.contentid,
            type: 'post',
            dataType: 'json',
            success: function (datas) {
              layer.closeAll()
              if (datas.flag == true) {
                if (lay_showType == 1) {
                  $('#showWorks').html('作业答题')
                } else {
                  $('#showWorks').html('考试答题')
                }
                var domain = datas.domain
                if (domain) {
                  domain = 'http://' + domain + '/'
                }
                $('.time-base').removeClass('current')
                $('#infoPageArea').addClass('current')
                $('#infoPageTarget').attr('src', paperAnswerUrl + '?paper_id=' + lay_id + '&user_id=' + user_id + '&des_deadline=' + lay_data.des_deadline + '&domain=' + domain + des_dlm)
              } else {
                layer.alert('作业/试卷答题截止时间已过期，无法继续答题!', { icon: 2, title: '提示' })
              }
            }
          })
        }
      }

      //保存dialog信息公用方法
      function layer_SaveData(L_type) {
        if (L_type == 1) {
          checkToPage()
        }
      }

      function getCourseware(accessType) {
        window.location = '${ctx}/study/crdl/' + courseid + '/' + isView + '?accessType=' + accessType
      }

      //多行文本输入框剩余字数计算
      function checkMaxInput(obj, maxLen) {
        if (obj == null || obj == undefined || obj == '') {
          return
        }
        if (maxLen == null || maxLen == undefined || maxLen == '') {
          maxLen = 100
        }

        var strResult
        var $obj = $(obj)
        var newid = $obj.attr('id') + 'msg'
        if (obj.value.length > maxLen) {
          //如果输入的字数超过了限制
          obj.value = obj.value.substring(0, maxLen) //就去掉多余的字
          strResult = '<span id="' + newid + "\" class='Max_msg' ><br/>已输入(" + obj.value.length + ')字,剩(' + (maxLen - obj.value.length) + ')字</span>' //计算并显示剩余字数
        } else {
          strResult = '<span id="' + newid + "\" class='Max_msg' ><br/>已输入(" + obj.value.length + ')字,剩(' + (maxLen - obj.value.length) + ')字</span>' //计算并显示剩余字数
        }

        var $msg = $('#' + newid)
        if ($msg.length == 0) {
          $obj.after(strResult)
        } else {
          $msg.html(strResult)
        }
      }

      /***********************************************主观题部分-2018年4月2日 11:04:53**********************************************************/

      function initSubjectiveDetailData() {
        // 清空主观题作答展示数据
        $('#subjective_id').val('')
        $('#subjectiveName').html('')
        $('#subjectiveContent').html('')
        $('#subDeadline').html('')
        // 上传文档作答区域（隐藏）
        $('#uploadAnswerFile').hide()
        // 下载文档按钮区域隐藏
        $('#downloadAnswerFile').hide()
        // 下载文档文件名称置空
        $('#upFile-show-alreadysubmit').html('')
        // 上传文件名称
        fileOldName = ''
        $('#answer_file').val('')
        // 上传文件名称展示
        $('#upFile-show').hide()
        // 上传文件名称置空
        $('#upFile-show').html('')
        // 在线作答时展示的区域（编辑器）
        $('#subjectiveAnswerPraseDiv').show()
        // 提交后在线作答展示区域
        $('#subjectiveAnswerPraseShowDiv').hide()
        $('#subjectiveAnswerPraseShowDiv').html('')

        // 上传图片按钮
        $('#imgUploadClick').show()
        // 提交按钮区域
        $('#submitButtonDiv').show()

        // 在线作答区域（显示）
        $('#onlineAnswer').show()
        // 提交时间
        $('#submitDateDiv').hide()
        // 参考答案
        $('#answerPraseDiv').hide()
        // 评分区域（发布成绩以及初评或终评后展示）
        $('#answerScoreArea').hide()
        // 上传图片展示部分（在线作答）
        $('#imgHtml').html('')
      }

      //主观题答题
      var deadline
      var subject_answer_id
      var subject_contentId
      var subject_outlineId
      var check_status
      function initSubjective(data) {
        deadline = data.deadline
        $('#area_8').hide()
        var datas = {
          user_id: user_id,
          content_id: data.id
        }
        $.ajax({
          url: '${ctx}/subjective/check_subjective_deadline',
          type: 'post',
          data: datas,
          dataType: 'json',
          success: function (msg) {
            var isPulishScoreFlag = msg.isPulishScoreFlag
            // deadline = msg.deadline;
            // 是否答题截止时间
            if (!msg.flag) {
              if (isPulishScoreFlag) {
                layer.alert('教师已经发布成绩，无法继续参与作答!', { icon: 2, title: '提示' })
                $('#area_8').hide()
                return
              }
              // 作答详情
              subject_contentId = data.id
              subject_outlineId = data.outlineid
              // ------------------------相关数据置空以及隐藏显示处理 -- begin
              initSubjectiveDetailData()
              // ------------------------相关数据置空以及隐藏显示处理 -- end
              // 初始化编辑器
              editor = UE.getEditor('subjectiveAnswerPrase', {
                initialFrameHeight: 300,
                autoHeightEnabled: false,
                elementPathEnabled: false,
                autoFloatEnabled: false,
                enableAutoSave: false,
                maximumWords: 500,
                toolbars: [['undo', 'redo', '|', 'bold', 'italic', '|', 'removeformat', 'cleardoc', '|', 'fontfamily', 'fontsize', '|', 'justifyleft', 'justifycenter', 'justifyright']]
              })
              // 展示作答用户作答详情
              subjectiveAnswerDetail(data)
            } else {
              layer.alert('答题截止时间已过期，无法继续答题!', { icon: 2, title: '提示' })
              $('#area_8').hide()
              return
            }
          }
        })
      }

      /**
       * 展示作答用户作答详情
       */
      function subjectiveAnswerDetail(data) {
        var contentId = data.contentid
        $.ajax({
          url: '${ctx}/subjective/getsubive/' + contentId + '/1',
          type: 'post',
          data: { course_id: courseid },
          success: function (datas) {
            $('#area_8').show()
            if (datas.flag == true || datas.flag == 'true') {
              // 加载主观题内容
              $('#subjective_id').val(datas.courseSubjective.subjective_id)
              $('#subjectiveName').html(datas.courseSubjective.subjective_name)
              $('#subjectiveContent').html(datas.courseSubjective.subjective_content)
              // 答题截止时间
              $('#subDeadline').html(deadline)
              // 参考答案
              var subjective_answer_prase = datas.courseSubjective.subjective_answer_prase
              // 成绩发布
              var mark_status = datas.courseSubjective.mark_status
              // 作答用户
              var ansewerUser = datas.ansewerUser
              // 作答图集
              var suAnswerAtlas = datas.suAnswerAtlas

              if (!isEmpty(ansewerUser)) {
                // 作答id
                subject_answer_id = ansewerUser.subject_answer_id
                // 作答状态
                check_status = ansewerUser.check_status
                if (isEmpty(check_status)) {
                  check_status = 0
                }
                if (check_status == 0) {
                  keepSubjectiveAnswerDetail(ansewerUser, suAnswerAtlas)
                } else {
                  submitSubjectiveAnserDetail(ansewerUser, suAnswerAtlas, mark_status, subjective_answer_prase)
                }
              } else {
                editor.setContent('')
                // 作答方式
                $.each($("input[name='answerType']"), function () {
                  var value = this.value
                  if (value == 0) {
                    this.checked = true
                  }
                  this.disabled = false
                })
              }
            } else {
              layer.alert('数据查询异常', { icon: 2, title: '提示' })
            }
          }
        })
      }

      /**
       * 用户作答详情（保存答案）
       *
       * @param ansewerUser	（作答用户）
       * @param suAnswerAtlas （图集）
       * @param mark_status  	（发布状态）
       */
      function keepSubjectiveAnswerDetail(ansewerUser, suAnswerAtlas) {
        // 作答状态
        check_status = ansewerUser.check_status
        // 作答方式
        var answer_type = ansewerUser.answer_type
        if (isEmpty(check_status)) {
          check_status = 0
        }
        if (isEmpty(answer_type)) {
          answer_type = 0
        }
        // 处理作答方式的显示效果
        checkedSubjectiveRadio(answer_type, check_status)

        var answer_content = ansewerUser.answer_content
        var answerImgDivId
        var answerImgId
        var imgPathIndexId
        var imgStr = ''
        // 文档上传展示
        $('#upFile-show').html('')
        // 展示上传图片按钮以及保存按钮区域
        $('#imgUploadClick').show()
        $('#submitButtonDiv').show()
        if (answer_type == 0) {
          // 在线作答
          // 加载作答内容（如果有的话）
          if (!isEmpty(answer_content)) {
            editor.setContent(answer_content)
          }
          if (!isEmpty(suAnswerAtlas)) {
            $.each(suAnswerAtlas, function (index, suAnsweratla) {
              answerImgDivId = 'answerImgShowDiv_' + suAnsweratla.atlas_id
              answerImgId = 'answerShowImg_' + suAnsweratla.atlas_id
              imgPathIndexId = 'imgShowPathIndex_' + suAnsweratla.atlas_id
              imgStr +=
                "<div id='" +
                answerImgDivId +
                "' class='imgshow-div'><i onclick='removeExitsImgHtml(" +
                answerImgDivId +
                ',' +
                suAnsweratla.atlas_id +
                ',' +
                imgPathIndexId +
                ")'></i>" +
                "<img id='" +
                answerImgId +
                "' class='imgshow-img' layer-src='" +
                suAnsweratla.fixImagePath +
                "' src='" +
                suAnsweratla.fixImagePath +
                "' style='cursor:pointer;'>" +
                /* "<input type='button' class='imgshow-remove' onclick='removeExitsImgHtml("+answerImgDivId+","+suAnsweratla.atlas_id+","+imgPathIndexId+")' value='移除'/>"+ */
                "<input type='hidden' class='subjectiveAnswerBeforeId' id='" +
                imgPathIndexId +
                "' value='" +
                suAnsweratla.image_path +
                "'/>" +
                '</div>'
            })
          }
          $('#imgHtml').append(imgStr)
          // 上传文档作答区域（隐藏）
          $('#uploadAnswerFile').hide()
          // 在线作答区域（显示）
          $('#onlineAnswer').show()
          // 判断图片上传数量是否达到上限
          getImgSpan_divLength(4)
        } else if (answer_type == 1) {
          // 上传文档
          // 作答内容置空
          editor.setContent('')
          // 上传文档作答区域（显示）
          $('#uploadAnswerFile').show()
          // 在线作答区域（隐藏）
          $('#onlineAnswer').hide()
          // 下载文档按钮隐藏
          $('#downloadAnswerFile').hide()
          // 展示上传文档名称
          var fileHtml = '<span>' + ansewerUser.answer_filename + '</span>'
          fileOldName = ansewerUser.answer_filename
          // $("#answer_file").val(ansewerUser.answer_file);
          $('#upFile-show').show()
          $('#upFile-show').html(fileHtml)
        }
      }

      /**
       * 用户作答详情（提交答案/初评/终评）
       *
       * @param ansewerUser	（作答用户）
       * @param suAnswerAtlas （图集）
       * @param mark_status  	（发布状态）
       * @param subjective_answer_prase  	（参考答案）
       */
      function submitSubjectiveAnserDetail(ansewerUser, suAnswerAtlas, mark_status, subjective_answer_prase) {
        // 作答状态
        check_status = ansewerUser.check_status
        // 作答方式
        var answer_type = ansewerUser.answer_type
        if (isEmpty(check_status)) {
          check_status = 0
        }
        if (isEmpty(answer_type)) {
          answer_type = 0
        }
        var answer_content = ansewerUser.answer_content
        // 处理作答方式的显示效果
        checkedSubjectiveRadio(answer_type, check_status)

        // 上传按钮隐藏
        $('#imgUploadClick').hide()
        // 保存提交按钮隐藏
        $('#submitButtonDiv').hide()
        var answerImgDivId
        var answerImgId
        var imgPathIndexId
        var imgStr = ''
        if (answer_type == 0) {
          // 在线作答
          editor.destroy()
          $('#subjectiveAnswerPraseDiv').hide()
          // 作答内容展示区域（）
          $('#subjectiveAnswerPraseShowDiv').show()
          $('#subjectiveAnswerPraseShowDiv').html(answer_content)
          if (!isEmpty(suAnswerAtlas) && suAnswerAtlas.length > 0) {
            // 上传图片展示区域
            $('#uploadImageDiv').show()
            $.each(suAnswerAtlas, function (index, suAnsweratla) {
              answerImgDivId = 'answerImgShowDiv_' + suAnsweratla.atlas_id
              answerImgId = 'answerShowImg_' + suAnsweratla.atlas_id
              imgPathIndexId = 'imgShowPathIndex_' + suAnsweratla.atlas_id
              imgStr +=
                "<div id='" +
                answerImgDivId +
                "' class='imgshow-div'>" +
                "<img id='" +
                answerImgId +
                "' class='imgshow-img' layer-src='" +
                suAnsweratla.fixImagePath +
                "' src='" +
                suAnsweratla.fixImagePath +
                "' style='cursor:pointer;'>" +
                "<input type='hidden' class='subjectiveAnswerBeforeId' id='" +
                imgPathIndexId +
                "' value='" +
                suAnsweratla.atlas_id +
                "'/>" +
                '</div>'
            })
            $('#imgHtml').append(imgStr)
            layer.photos({
              photos: '#imgHtml',
              shade: 0.8,
              closeBtn: 2,
              shift: 5, //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
              area: ['900px', '500px']
            })
          } else {
            $('#uploadImageDiv').hide()
          }
          // 上传文档作答区域（隐藏）
          $('#uploadAnswerFile').hide()
          // 下载文档按钮区域隐藏
          $('#downloadAnswerFile').hide()
          // 在线作答区域显示
          $('#onlineAnswer').show()
        } else if (answer_type == 1) {
          // 上传文档
          // 上传文档作答区域（隐藏）
          $('#uploadAnswerFile').hide()
          // 下载文档按钮区域展示
          $('#downloadAnswerFile').show()
          // 在线作答区域隐藏
          $('#onlineAnswer').hide()
          // 回显上传文档文件名
          var fileHtml = '' + ansewerUser.answer_filename + ''
          $('#upFile-show-alreadysubmit').html(fileHtml)
        }

        // 提交时间
        $('#submitDateDiv').show()
        $('#submitDate').html(ansewerUser.submit_date)
        // 参考答案
        if (!isEmpty(subjective_answer_prase) && mark_status == 1) {
          $('#answerPraseDiv').show()
          $('#subjectiveAnswerForTeacher').html(subjective_answer_prase)
        } else {
          $('#answerPraseDiv').hide()
        }
        // 评分区域
        if (check_status == 2 && mark_status == 1) {
          $('#answerScoreArea').show()
          $('#score').html("<span style='color:red'>" + ansewerUser.pre_score + '</span> 分')
          if (isEmpty(ansewerUser.comment)) {
            $('#answerComment').html('暂无')
          } else {
            $('#answerComment').html(ansewerUser.comment)
          }
        } else if (check_status == 3 && mark_status == 1) {
          $('#answerScoreArea').show()
          $('#score').html("<span style='color:red'>" + ansewerUser.final_score + '</span> 分')
          if (isEmpty(ansewerUser.comment)) {
            $('#answerComment').html('暂无')
          } else {
            $('#answerComment').html(ansewerUser.comment)
          }
        } else {
          $('#answerScoreArea').hide()
        }
      }

      /**
       * 作答方式的选中判断
       */
      function checkedSubjectiveRadio(answer_type, check_status) {
        var oAnswerType
        var oAnswerTypes = $("input[name='answerType']")
        $.each(oAnswerTypes, function () {
          oAnswerType = this.value
          if (oAnswerType == answer_type) {
            this.checked = true
          }
          if (check_status == 0) {
            this.disabled = false
          } else {
            this.disabled = true
          }
        })
      }

      /**
       * 判断内容是否为空
       */
      function isEmpty(obj) {
        if (typeof obj == undefined || obj == null || obj == '') {
          return true
        } else {
          return false
        }
      }

      var index = 0 // 添加索引
      /**
       * 主观题作答上传图片的方法
       */
      function uploadAnswerImg(button) {
        var answerImgDivId // 图片外层div的id
        var answerImgId // 图片id
        var imgPathIndexId // 存储图片路径id
        new AjaxUpload(button, {
          action: '${ctx}/subjective/upload_answer_file?type=1',
          name: 'upload',
          onSubmit: function (file, ext, size) {
            if (!(ext && /^(jpeg|JPEG|jpg|JPG|png|PNG)$/.test(ext))) {
              parent.layer.alert('您上传的图片格式不对，请重新选择！', { icon: 0, title: '提示' })
              return false
            }
            var fileMaxSize = 2 * 1024 * 1000
            if (size > fileMaxSize) {
              parent.layer.alert('您上传的图片大小过大，请重新选择！', { icon: 0, title: '提示' })
              return false
            }
            $('#loadingUpImg').show()
            this.disable()
          },
          onComplete: function (file, response) {
            var result = eval('(' + response + ')')
            if (result.flag == true) {
              getImgSpan_divLength(3)
              $('#loadingUpImg').hide()
              index++
              var data = getAddImgHtmlMsg(index)
              var imgHtml = data.imgHtml
              // 图片外层div的id
              answerImgDivId = data.answerImgDivId
              // 图片id
              answerImgId = data.answerImgId
              // 存储图片路径id
              imgPathIndexId = data.imgPathIndexId
              $('#imgHtml').append(imgHtml)
              $('#' + imgPathIndexId).val(result.relPath)
              $('#' + answerImgId).attr('src', dataPath + result.relPath)
            } else if (result.flag == false) {
              parent.layer.alert('上传失败，上传异常或文件格式错误！', { icon: 2, title: '提示' })
            }
            this.enable()
          }
        })
      }

      /**
       * 移除上传主观题答题图片
       */
      function removeImgHtml(removeObject, removeImgPathObject) {
        var imgPath = removeImgPathObject.value
        removeObject.remove()
        deleteFile(imgPath)
      }

      /**
       * 删除文件
       */
      function deleteFile(filePath) {
        if (!isEmpty(filePath)) {
          $.ajax({
            url: '${ctx}/subjective/remove_answer_file',
            type: 'post',
            data: {
              imgPath: filePath
            },
            success: function (datas) {
              var result = eval('(' + datas + ')')
              if (result.flag == true || result.flag == 'true') {
                layer.msg('移除成功！', { icon: 1, time: 500 })
                getImgSpan_divLength(4)
              } else {
                layer.msg('移除失败！', { icon: 2, time: 500 })
              }
            }
          })
        }
      }

      /**
       * 移除已存在作答内容的图片
       */
      var removeAnswerUserAtlasIds = []
      var removeImgPaths = []
      function removeExitsImgHtml(removeObject, removeAnswerUserAtlasId, removeImgPathObject) {
        var imgPath = removeImgPathObject.value
        removeAnswerUserAtlasIds.push(removeAnswerUserAtlasId)
        removeImgPaths.push(imgPath)
        removeObject.remove()
        layer.msg('移除成功！', { icon: 1, time: 500 })
        getImgSpan_divLength(4)
      }

      /**
       * 拼接主观题答题展示图片html
       */
      function getAddImgHtmlMsg() {
        var answerImgDivId = 'answerImgDiv_' + index
        var answerImgId = 'answerImg_' + index
        var loadingAnswerImgId = 'loadingAnswerImg_' + index
        var imgPathIndexId = 'imgPathIndex_' + index
        var imgHtml =
          "<div id='" +
          answerImgDivId +
          "' class='imgshow-div'><i onclick='removeImgHtml(" +
          answerImgDivId +
          ',' +
          imgPathIndexId +
          ")'></i>" +
          "<img id='" +
          answerImgId +
          "' class='imgshow-img'>" +
          /* "<input type='button' class='imgshow-remove' onclick='removeImgHtml("+answerImgDivId+","+imgPathIndexId+")' value='移除'/>"+ */
          "<input type='hidden' class='uploadImgPaths' id='" +
          imgPathIndexId +
          "' value='" +
          index +
          "'/>" +
          '</div>'
        var data = {
          imgHtml: imgHtml,
          answerImgDivId: answerImgDivId,
          answerImgId: answerImgId,
          imgPathIndexId: imgPathIndexId,
          loadingAnswerImgId: loadingAnswerImgId
        }
        return data
      }

      /**
       * 判断图片上传数量不能超过4张
       */
      function getImgSpan_divLength(num) {
        var divNum = document.getElementById('imgHtml').getElementsByTagName('div').length
        if (divNum >= num) {
          $('#imgUploadClick').hide()
        } else {
          $('#imgUploadClick').show()
        }
      }

      /**
       * 主观题作答上传作答文档
       */
      var fileOldName = ''
      function uploadAnswerUserFile(button) {
        new AjaxUpload(button, {
          action: '${ctx}/subjective/upload_answer_file?type=2',
          name: 'upload',
          onSubmit: function (file, ext, size) {
            if (!(ext && /^(pdf|pdfx|doc|docx)$/.test(ext))) {
              parent.layer.alert('您上传的文件格式不对，请重新选择！', { icon: 0, title: '提示' })
              return false
            }
            var fileMaxSize = 4 * 1024 * 1000
            if (size > fileMaxSize) {
              parent.layer.alert('您上传的文件大小过大，请重新选择！', { icon: 0, title: '提示' })
              return false
            }
            $('#upFile-loading').show()
            $('#upFile-show').hide()
            this.disable()
          },
          onComplete: function (file, response) {
            var result = eval('(' + response + ')')
            if (result.flag == true) {
              var beforeFilePath = $('#answer_file').val()
              if (!isEmpty(beforeFilePath)) {
                deleteFile(beforeFilePath)
              }
              fileOldName = result.fileOldName
              var fileHtml = '<span>' + fileOldName + '</span>'
              $('#answer_file').val(result.relPath)
              $('#upFile-show').html(fileHtml)
              $('#upFile-loading').hide()
              $('#upFile-show').show()
            } else if (result.flag == false) {
              parent.layer.alert('上传失败，上传异常或文件格式错误！', { icon: 2, title: '提示' })
            }
            this.enable()
          }
        })
      }

      /**
       * @type  保存状态 ：0-保存、1-保存并提交
       */
      function saveData(type) {
        // 上传图片路径
        var imgArray = getImgPaths()
        // 主观题id
        var subjective_id = $('#subjective_id').val()
        // 作答方式
        var answer_type = $("input[name='answerType']:checked").val()
        // 作答内容
        var answer_content = ''
        // 上传文档路径
        var answer_file = $('#answer_file').val()
        // 上传文档名称
        var upFile_show = $('#upFile-show').text()
        if (answer_type == 0) {
          answer_content = editor.getContent()
          var answer_content_length = editor.getContentLength(true)
          if (isEmpty(answer_content)) {
            parent.layer.alert('请填写作答内容！', { icon: 0, title: '提示' })
            return false
          }
          if (answer_content_length > 10000) {
            parent.layer.alert('作答内容字数超过限制!', { icon: 0, title: '提示' })
            return false
          }
        } else {
          if (isEmpty(answer_file) && isEmpty(subject_answer_id)) {
            parent.layer.alert('请上传作答文件！', { icon: 0, title: '提示' })
            return false
          }
          /* 为了解决 主观题先上传文档未保存，然后在线作答保存 ，再到上传文档时空文件保存*/
          if (!isNotBlank(answer_file) && !isNotBlank(upFile_show)) {
            parent.layer.alert('请上传作答文件', { icon: 0, title: '提示' })
            return false
          }
        }
        var data = {
          course_id: courseid,
          content_id: subject_contentId,
          outline_id: subject_outlineId,
          subjective_id: subjective_id,
          user_id: user_id,
          answer_content: answer_content,
          answer_type: answer_type,
          check_status: type,
          answer_filename: fileOldName,
          answer_file: answer_file
        }
        $.ajax({
          url: '${ctx}/subjectiveuser/save_subjectiveansweruser?answer_atlas_paths=' + imgArray + '&answer_atlas_ids=' + removeAnswerUserAtlasIds + '&remove_imgPaths=' + removeImgPaths,
          type: 'post',
          data: data,
          success: function (datas) {
            if (datas.flag == true || datas.flag == 'true') {
              var data = {
                id: subject_contentId,
                outlineid: subject_outlineId,
                contentid: subjective_id,
                deadline: deadline
              }
              editor.setContent('')
              /* 提交时候添加学习记录 */
              /* if(type == 1){
      		saveSubjectiveRecord();
      	} */
              initSubjective(data)
            } else {
              layer.alert(datas.msg, { icon: 2, title: '提示' })
            }
          }
        })
      }

      /* 保存主观题学习记录 */
      function saveSubjectiveRecord() {
        $.ajax({
          url: '${ctx}/study/saveStudyRecord/' + subject_contentId + '/' + subject_outlineId + '/' + courseid + '/8',
          type: 'post',
          success: function (msg) {}
        })
      }

      /**
       * 获取图片路径
       */
      function getImgPaths() {
        var imgPaths = []
        var oImgPaths = $('#imgHtml .uploadImgPaths')
        $.each(oImgPaths, function () {
          imgPaths.push(this.value)
        })
        return imgPaths
      }

      /**
       * 修改时获取以保存过的图片id
       */
      function getAnswerAtlasId() {
        var answerIds = []
        var bfAnswerIds = $('#imgHtml .subjectiveAnswerBeforeId')
        $.each(bfAnswerIds, function () {
          answerIds.push(this.value)
        })
        return answerIds
      }

      /* 显示或隐藏不同形式的作答区域 */
      function radioChecked() {
        var answerType = $("input[name='answerType']:checked").val()
        if (answerType == 0) {
          $('#onlineAnswer').show()
          $('#uploadAnswerFile').hide()
        } else {
          $('#onlineAnswer').hide()
          $('#uploadAnswerFile').show()
        }
      }

      /* 取消答题 */
      function cacalAnswer() {
        getCourseware(1)
      }

      /* 下载文件 */
      function downloadAnswerFile() {
        window.location.href = '${ctx}/subjectiveuser/download_answerfile/' + subject_answer_id + '/' + user_id
      }

      // 判断用户当前是否使用Chome浏览器
      function isChrome() {
        var sUsrAg = navigator.userAgent
        var isChrome = false
        if (sUsrAg.indexOf('Chrome') > -1) {
          isChrome = true
        }
        return isChrome
      }

      // 初始化H5播放器
      function initH5Player(videoData, videoBulletData) {
        var play_url, play_url0, play_url1, play_url2

        var videoPlaylist = {}
        if (videoData.jisuM3u8) {
          // 标清
          play_url0 = api_export_play_url + '&base_path=' + videoData.jisuM3u8 + '/'
          Object.assign(videoPlaylist, { biaoqing: { url: play_url0, type: api_export_video_type } })
          play_url = play_url ? play_url : play_url0
        }
        if (videoData.biaoqingM3u8) {
          // 高清
          play_url1 = api_export_play_url + '&base_path=' + videoData.biaoqingM3u8 + '/'
          Object.assign(videoPlaylist, { gaoqing: { url: play_url1, type: api_export_video_type } })
          play_url = play_url ? play_url : play_url1
        }
        if (videoData.gaoqingM3u8) {
          // 超清
          play_url2 = api_export_play_url + '&base_path=' + videoData.gaoqingM3u8 + '/'
          Object.assign(videoPlaylist, { chaoqing: { url: play_url2, type: api_export_video_type } })
          play_url = play_url ? play_url : play_url2
        }

        var video_type = api_export_video_type
        var dolit_player_args = {
          options: {
            // 必选项，其子项为可选项
            is_playlist: 0, // 是否显示播放列表，0位不显示 1为显示
            pauseAd: 0, // 视频暂停是否显示广告，0 不显示 1 显示
            is_definition: 1, // 是否显示清晰度
            back_sec: 0, // 回答错误强制回看多少秒
            is_speed_bar: 1, // 是否显示倍速按钮
            is_set_bar: 0, // 是否显示设置按钮
            is_next_bar: 0, // 是否显示下一集的按钮
            is_autoplay: 0, // 是否自动播放
            is_bili_keep: 1, // 是否默认保持视频原比例 1 默认保持视频比例 0 默认铺满
            is_allow_native_video: 1, // 不支持水印等自定义皮肤的浏览器是否允许视频播放 1 允许播放 0 不允许播放
            not_support_msg: '您的浏览器不支持当前视频，请升级您的浏览器',

            is_forbid_video_enc: 0, // 是否禁用加密功能，如果您的m3u8文件不是加密文件，则该选项设置为1，否则不必设置该选项
            is_custom_fullscreen: 0, // 是否显示自定义全屏
            is_forbid_fullscreen: 0, // 是否取消默认全屏皮肤
            is_pc_forbid_fullscreen: 0, // pc是否禁止全屏
            is_ios_forbid_fullscreen: 1, // ios端是否禁止全屏
            is_andriod_forbid_fullscreen: 0, // 安卓端是否禁止全屏，如果开启了is_forbid_lower_andriod，可以允许全屏,并可以保留弹幕
            is_forbid_lower_andriod: 0, // 是否只允许安卓下 chrome/70以上的播放器播放

            is_ios_only_wechat: 0, // 是否IOS下只允许微信内打开
            is_andriod_only_wechat: 0, // 是否安卓下只允许微信内打开
            is_forbid_ios: 0, // 是否禁用ios端
            is_forbid_andriod: 0, // 是否禁用andriod端
            is_forbid_pc_chrome: 0, // 是否禁用pc端chrome
            is_forbid_pc_safari: 0 // 是否禁用pc端safari
          },
          // 授权域名，请使用接口生成授权域名 localhost, 192.168.42.13, www.pmphmooc.com, 117.107.141.226, rwspoc.pmphmooc.com
          allow_domain: [
            '9BC995B064F6F61D6F880D145BBE3A4D',
            'E8FC18814F3F6CCDF1B729259F03DA67',
            '7591E597567411EE661632283C373A11ED1EB65E015D9C94AC2024E851BC8C0E',
            'F48CF50C3704A2089C26D58DDEA547B4',
            'EF60A8A788B2ABC50C29E3C9B8953D0DA96D436CAC2DD90900D1E9ADB1B1B957'
          ],
          play_url: play_url, // 必选项
          video_type: video_type, // 必选项
          playlist: [
            // 必选项
            {
              id: '001',
              video: videoPlaylist,
              backvideo: {
                by: '' // 手机端遇到不支持的flv时的备用url地址
              },
              track: videoData.content,
              poster: '',
              title: '',
              // 弹题
              subject: videoBulletData,
              // 弹图片
              advert: [],
              // 水印
              watermark: {},
              barrage: []
            }
          ]
        }
        dlplayer(dolit_player_args)
      }
    </script>
  </head>
  <style>
    .page {
      background: rgba(0, 0, 0, 0.8);
      margin: 0px;
      position: relative;
      z-index: 9999;
      width: 100%;
      height: 100%;
      position: fixed;
      display: none;
    }
    .reset {
      height: 380px;
      width: 820px;
      border: 7px solid #efefef;
      padding: 30px 40px;
      font-size: 15px;
      position: absolute;
      left: 50%;
      top: 70px;
      margin-left: -420px;
      background: #fff;
      position: relative;
    }
    .currenttopage {
      height: 50px;
      color: #fff;
      margin-top: -4px;
      line-height: 50px;
    }
    .hs {
      float: right;
      margin: 30px 30px 0px 30px !important;
      font-size: 14px !important;
      padding: 0px !important;
    }
    .vadio_box {
      clear: both;
    }
    .talk_box {
      clear: both;
    }
    #mediaplayer_wrapper {
      padding-left: 40px;
    }
  </style>
  <body>
    <c:set var="platformType" value="<%=platformType%>"></c:set>
    <c:choose>
      <c:when test="${platformType==3}">
        <jsp:include page="graduate-headersp.jsp" />
      </c:when>
      <c:otherwise>
        <c:choose>
          <c:when test="${sessionScope.agency.type==4}">
            <jsp:include page="graduate-headersp.jsp" />
          </c:when>
          <c:otherwise>
            <jsp:include page="headersp.jsp" />
          </c:otherwise>
        </c:choose>
      </c:otherwise>
    </c:choose>

    <form id="discussForm">
      <input type="hidden" name="course_id" value="${courseid}" />
      <input type="hidden" id="content" name="content" />
      <input type="hidden" id="topic_id" name="parent_id" />
      <input type="hidden" name="is_content" value="0" />
      <input type="hidden" name="content_id" id="discuss_content_id" />
    </form>

    <div class="contect">
      <div class="con-page" style="position: relative">
        <button id="returnList" onclick="goHome();" style="height: 30px; width: 90px; background: #f56d01; position: absolute; right: 1px; top: 5px; color: #fff; cursor: pointer; display: none">
          返回
        </button>
        <div class="main-cir-L">
          <jsp:include page="coursedetail_left.jsp" />
          <div class="main_base">
            <!-- 课件 -->
            <div class="time-base current">
              <div class="time-B-con">
                <h2 class="fila_tit"><span class="flia_li">课件</span></h2>
                <ul class="page_num" id="courseware"></ul>
              </div>
            </div>

            <!-- 自定义页面区 -->
            <div class="time-base" id="diyPageDiv">
              <h2 class="fila_tit"><span class="flia_li" id="diyTitle"></span></h2>
              <div class="con_Center con_change" style="margin-top: 30px" id="diyContent"></div>
            </div>

            <div class="time-base" id="spec">
              <div class="time-B-con">
                <h2 class="fila_tit">
                  <a href="#" onclick="getCourseware(1);">课件</a>
                  <span>></span>
                  <select id="parentselect" onchange="changeItem(this.value);" style="font-size: 14px"></select>
                  <span>></span>
                  <select id="subselect" onchange="changeSubItem(this.value);" style="font-size: 14px"></select>
                </h2>
              </div>
              <div class="vadio_wrap">
                <!--课件导航  -->
                <div class="vadio_tab">
                  <ul id="contentlist"></ul>
                </div>
                <!--视频 -->
                <div class="vadio_list" id="area_1">
                  <h3 id="videoTitle" style="float: left"></h3>
                  <h3 class="hs"></h3>
                  <img src="${ctx}/relfile/images/list/icon8.png" id="is_Collection" class="lea-s" onclick="favor(this);" style="float: right; margin-top: 50px; margin-right: 10px" title="收藏" />
                  <div class="vadio_box" style="" oncontextmenu="return false">
                    <!-- onended="finishView();" -->
                    <!-- <video id="videoArea"  controls="controls" autoplay="" style="width:90%;height:100%;margin:auto 4%;">
	                            		<track kind="subtitles" label="Chinese subtitles" src="" id="tkArea" srclang="zh" label="Chinese">
	                            	</video> -->
                    <!-- 视频 -->
                    <div id="mediaplayer"></div>

                    <!-- h5播放器 -->
                    <div class="video-box" id="video-box" style="margin: 0px auto; margin-top: 10px">
                      <video
                        id="myVideo"
                        data-theme="black"
                        data-definition="biaoqing"
                        data-bili="4:3"
                        data-speed="1"
                        data-id="001"
                        class="video-js vjs-default-skin vjs-big-play-centered"
                        webkit-playsinline="true"
                        x-webkit-airplay="allow"
                        playsinline
                        width="100%"
                        height="100%"
                        x5-video-player-type="h5"
                        x5-video-player-fullscreen="true"
                        controls
                        preload="auto"
                        poster=""
                        controlsList="nofullscreen nodownload noremote"
                        disablePictureInPicture
                        crossorigin="anonymous"
                      ><track srclang="zh" kind="subtitles" label="中文" default /></video>
                      <div class="video-info">
                        <!-- 题目 -->
                        <div class="video-info_subject"></div>
                      </div>
                    </div>
                    <!-- /h5播放器 -->

                    <input type="hidden" id="video_outlineid" />
                    <input type="hidden" id="video_contentid" />
                  </div>
                </div>
                <!-- 文档 -->
                <div class="vadio_list" id="area_2">
                  <h3 id="dataTitle" style="float: left"></h3>
                  <h3 class="hs"></h3>
                  <div>
                    <iframe id="frameD" frameborder="0" scrolling="auto" style="width: 100%; height: 800px; overflow: hidden; margin: 0"></iframe>
                  </div>
                </div>
                <!-- 作业、考试 -->
                <div class="vadio_list" id="area_4">
                  <h3 id="examTitle" style="float: left"></h3>
                  <h3 class="hs"></h3>
                  <div>
                    <span id="frameH" style="visibility: hidden;"></span>
                    <!-- <iframe id="frameH" frameborder="0" scrolling="auto" style="width: 100%; height: 800px; overflow: hidden; margin: 0"></iframe> -->
                  </div>
                </div>
                <!-- 讨论 -->
                <div class="vadio_list" id="area_3">
                  <div class="time-B-con">
                    <h3 id="discussInnerTitle" style="margin: 20px 0; padding: 0px; float: left"></h3>
                    <h3 class="hs"></h3>
                    <div class="talk_box">
                      <div class="det_list" style="height: auto">
                        <h4>课件讨论</h4>
                        <div class="det_list_con">
                          <!-- <p id="discussTitle"></p>
												<p id="discussContent"></p> -->
                          <div>
                            <span style="float: left"><img id="talkUserPhoto" src="" style="width: 24px; height: 24px" /></span>
                            <span id="talkUser" style="float: left; padding-left: 18px; color: #1f8fcf"></span>
                            <span id="talkUserTime" style="float: right; font-size: 8px; color: #999"></span>
                          </div>
                          <div style="clear: both">
                            <span><h3 id="discussTitle" style="float: left; padding-left: 38px; padding: 0px 0px 0px 37px"></h3></span>
                          </div>
                          <div id="discussContent" style="clear: both; padding-left: 20px"></div>
                        </div>
                      </div>

                      <!-- 发表讨论 -->
                      <div class="reply_textarea">
                        <textarea
                          id="myDiscuss"
                          invalidMessage="最大长度不能超过800"
                          onkeydown="checkMaxInput(this,800)"
                          onkeyup="checkMaxInput(this,800)"
                          onfocus="checkMaxInput(this,800)"
                          onblur="checkMaxInput(this,800);"
                        ></textarea>

                        <div class="btnArea">
                          <button onclick="clearTalkContent();">取消</button>
                          <button onclick="saveDiscuss();">提交</button>
                        </div>
                      </div>

                      <!-- 讨论回复列表 -->
                      <div class="talk_list" id="replylist"></div>
                      <div class="page1" id="discuss_detail_page" style="display: none; padding-bottom: 30px">
                        <input id="dd_discussPageNo" type="hidden" />
                        <input id="dd_discussTotalPage" type="hidden" />
                        <span id="dd_shouyeG" onclick="dd_changeNo(-1)">首页</span>
                        <span id="dd_shangyiyeG" onclick="dd_changeNo(1)">上一页</span>
                        <span id="dd_pageCenter"></span>
                        <span id="dd_xiayiyeG" onclick="dd_changeNo(2)">下一页</span>
                        <span id="dd_moyeG" onclick="dd_changeNo(-2)">末页</span>
                        <span class="color2" onclick="dd_changeNo(0)" style="margin-left: 50px">跳转</span>
                        <input value="" id="tiaozhuan2" type="text" style="width: 50px; border: 1px; border-style: solid; border-color: #d3d3d3" />
                        <span>页</span>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="vadio_list" id="area_6">
                  <h3 class="hs"></h3>
                  <div id="htmlTitle" style="margin: 10px 0px; text-align: center; clear: both"></div>
                  <div id="htmlDiv" style="min-height: 200px; margin: 14px 0px"></div>
                </div>

                <!-- 主观题：2018年4月2日 14:05:04 -->
                <div class="vadio_list" id="area_8">
                  <input type="hidden" />
                  <div class="time-B-con">
                    <input type="hidden" id="subjective_id" value="" />
                    <div class="subjective-base-div" id="nameDiv">
                      <label style="">题目名称：</label>
                      <div id="subjectiveName" style="margin-top: -26px; padding-left: 80px"></div>
                    </div>
                    <div class="subjective-base-div" id="contentDiv">
                      <label style="">题目内容：</label>
                      <div id="subjectiveContent" style="margin-top: -26px; padding-left: 80px"></div>
                    </div>
                    <div class="subjective-base-div" id="deadLineDiv">
                      <label style="">截止时间：</label>
                      <div id="subDeadline" style="margin-top: -26px; padding-left: 80px"></div>
                    </div>
                    <div class="subjective-base-div" id="answerTypeDiv">
                      <label style="float: left">作答方式：</label>
                      <div id="answerType" style="padding-left: 80px">
                        <input type="radio" name="answerType" class="change_type1" value="0" checked="checked" onclick="radioChecked()" />
                        <label class="type_one">在线作答</label>
                        <input type="radio" name="answerType" class="change_type2" value="1" style="margin-left: 30px" onclick="radioChecked()" />
                        <label class="type_one">上传文档</label>
                      </div>
                    </div>
                    <!-- 在线作答  -->
                    <div id="onlineAnswer" style="border-bottom: 1px solid #e8e6e6; margin: 20px 10px 10px 30px; padding-bottom: 20px">
                      <div style="clear: both" id="answerContentDiv">
                        <label style="float: left">作答内容：</label>
                        <div id="subjectiveAnswerPraseDiv">
                          <textarea id="subjectiveAnswerPrase" style="width: 90%; margin-left: 80px"></textarea>
                        </div>
                        <div id="subjectiveAnswerPraseShowDiv" style="width: 90%; margin-left: 80px; display: none"></div>
                      </div>
                      <div style="padding-bottom: 6px" id="uploadImageDiv">
                        <label style="float: left; margin-top: 16px">上传图片：</label>
                        <div id="uploadImage" style="padding-top: 15px; padding-left: 80px; height: 146px">
                          <input type="hidden" id="imgUploadPath" name="imgUploadPath" />
                          <div id="imgShow" style="float: left">
                            <span id="imgHtml"> </span>
                            <div class="imgLoading-show" id="loadingUpImg">
                              <span class="upImg-loading"><img src="${ctx}/resources/images/show.gif" /> 正在上传，请稍后... </span>
                            </div>
                            <div id="imgUploadClick" style="float: left; margin-left: 15px">
                              <img class="upImg-css" src="${ctx}/relfile/images/zgt/tpsc.png" id="imgUpload" onclick="uploadAnswerImg(this)" ; />
                            </div>
                          </div>
                        </div>
                      </div>
                      <div style="font-size: 10px; margin-left: 80px; margin-top: 45px; color: red">图片格式要求：仅支持jpeg、jpg、png且小于2M</div>
                    </div>
                    <!-- 上传文档 （作答时）-->
                    <div id="uploadAnswerFile" style="display: none; border-bottom: 1px solid #e8e6e6; margin: 20px 10px 0px 30px; padding-bottom: 15px">
                      <div style="clear: both; padding-bottom: 15px" id="answerContentDiv">
                        <label style="float: left; margin-top: 16px">作答内容：</label>
                        <button id="uploadAnswerUser-file" onclick="uploadAnswerUserFile(this)" class="subjective-upload-answerfile">上传作答文件</button>
                        <span id="upFile-show" class="upload-answer-file" style="left: 72px; display: none"> </span>
                      </div>
                      <div id="upFile-loading" class="upload-answer-file" style="display: none">
                        <div style="float: left"><img src="${ctx}/resources/images/show.gif" /></div>
                        <div class="upload-answer-loading"><span>正在上传，请稍后...</span></div>
                      </div>
                      <input id="answer_file" name="answer_file" type="hidden" value="" />
                      <span style="margin-left: 72px; color: red">上传支持格式：doc、docx、pdf，支持大小：小于4M ( 上传作答文件后如需修改，请再次“上传”并“保存” )</span>
                    </div>
                    <!-- 下载文档（提交时） -->
                    <div id="downloadAnswerFile" style="display: none; border-bottom: 1px solid #e8e6e6; margin: 20px 10px 0px 30px; padding-bottom: 15px">
                      <label style="float: left; margin-top: 16px">作答内容：</label>
                      <button onclick="downloadAnswerFile()" class="subjective-upload-answerfile">下载作答文件</button>
                      <span id="upFile-show-alreadysubmit" style="margin-left: 30px; color: red"></span>
                    </div>

                    <!-- 提交时展示 -->
                    <div class="subjective-base-div" style="display: none" id="answerPraseDiv">
                      <label style="">参考答案：</label>
                      <div id="subjectiveAnswerForTeacher" style="margin-top: -26px; padding-left: 80px"></div>
                    </div>
                    <div class="subjective-base-div" style="display: none" id="submitDateDiv">
                      <label style="">提交时间：</label>
                      <div id="submitDate" style="margin-top: -26px; padding-left: 80px"></div>
                    </div>

                    <!-- 初评、终评展示 -->
                    <div id="answerScoreArea" style="display: none">
                      <div class="subjective-base-div" id="scoreDiv">
                        <label style="">答题得分：</label>
                        <div id="score" style="margin-top: -26px; padding-left: 80px"></div>
                      </div>
                      <div class="subjective-base-div" id="answerCommentDiv">
                        <label style="">教师评价：</label>
                        <div id="answerComment" style="margin-top: -26px; padding-left: 80px"></div>
                      </div>
                    </div>

                    <div id="submitButtonDiv" style="padding: 100px 0px 10px 255px">
                      <button onclick="saveData(0)" class="subjective-answeruser-button">保存</button>
                      <button onclick="saveData(1)" class="subjective-answeruser-button">保存与提交</button>
                      <button onclick="cacalAnswer()" class="subjective-answeruser-cancelbtn">取消</button>
                    </div>
                  </div>
                </div>
              </div>
            </div>

            <div class="time-base" id="infoPageArea">
              <h2 class="fila_tit"><span class="flia_li" id="showWorks"></span></h2>
              <iframe id="infoPageTarget" frameborder="0" scrolling="auto" style="width: 100%; height: 800px; overflow: hidden; margin: 0"></iframe>
            </div>
          </div>
        </div>
      </div>
    </div>

    <form id="talkForm">
      <input type="hidden" name="course_id" value="${courseid}" />
      <input type="hidden" id="talkcontent" name="content" />
      <input type="hidden" name="parent_id" value="0" />
      <input type="hidden" name="title" id="talkTitle" />
      <input type="hidden" name="is_content" value="1" />
    </form>
    <form id="topForm">
      <input type="hidden" name="course_id" value="${courseid}" />
      <input type="hidden" id="topContent" name="content" />
      <input type="hidden" name="parent_id" id="top_parent_id" />
      <input type="hidden" name="title" id="top_title" />
      <input type="hidden" name="is_content" id="top_is_content" />
    </form>
    <form id="singleForm">
      <input type="hidden" name="course_id" value="${courseid}" />
      <input type="hidden" id="singleContent" name="content" />
      <input type="hidden" name="parent_id" id="singleParentId" />
      <input type="hidden" name="title" id="singleTitle" />
      <input type="hidden" name="is_content" id="singleIsContent" />
    </form>
    <div class="page">
      <input type="hidden" id="top_type" />
      <div class="reset">
        <div class="re_con">
          <textarea id="topTalkArea" style="width: 100%"></textarea>
          <button style="background: #1f8fcf; color: #fff; font-size: 15px; width: 140px; height: 36px; float: left; margin: 10px 20px 0px 205px; cursor: pointer" onclick="saveTopTalk();">
            保存
          </button>
          <button style="background: #1f8fcf; color: #fff; font-size: 15px; width: 140px; height: 36px; float: left; margin: 10px 20px 0px 30px; cursor: pointer" onclick="closeSingleTalk();">
            取消
          </button>
        </div>
      </div>
    </div>

    <!-- 选择继续答题或者  -->
    <div id="goToPageDlg" style="display: none">
      <div style="margin: 50px 0px 0px 30px; font-size: 14px">
        请选择操作类型:
        <input type="radio" name="operateType" value="0" style="margin-left: 20px" checked="checked" />查看解析 <input type="radio" name="operateType" value="1" style="margin-left: 40px" />继续答题
      </div>
    </div>

    <!-- 试卷包查看试卷列表 -->
    <div id="paperDialog" style="width: 760px; height: 390px">
      <table id="paperGrid" toolbar="#paperTb"></table>
    </div>
    <div id="paperTb" style="padding: 3px; display: none">
      <span style="font-size: 12px">检索条件:</span>
      <input name="paperSeachType" id="paperSeachType" type="hidden" />
      <input id="paperName" placeholder="试卷名称" style="line-height: 26px; border: 1px solid #ccc; width: 200px" />
      <a href="javascript:void(0);" class="easyui-linkbutton" plain="true" onclick="f_selectPaper();">搜索</a>
    </div>
    <jsp:include page="footer.jsp" />
    <style type="text/css">
      .color1 {
        color: #c0c0c0;
        cursor: inherit;
      }
      .color2 {
        color: #2883bc;
        cursor: pointer;
      }
      /* 讨论回复textarea样式-01 */
      .reply_textarea {
        position: relative;
        padding-left: 8px;
        margin-top: 18px;
        height: 340px;
      }
      /* 讨论回复textarea样式-02 */
      .reply_textarea textarea {
        border: 1px solid #c7c7c7;
        height: 300px;
        width: 840px;
        resize: none;
      }
      .btnArea button:nth-of-type(1) {
        background: #fff;
        color: #333;
        border: 1px solid #d7d7d7;
      }
      .btnArea button {
        float: right;
        height: 36px;
        width: 80px;
        background: #1f8fcf;
        color: #fff;
        font-size: 15px;
        margin: 15px;
      }
      /* 2018年3月23日 09:44:23 */
      .upImg-css {
        width: 150px;
        height: 130px;
        /* border: 1px dashed #030303; */
        padding: 10px;
        cursor: pointer;
        background-color: #f8f8f8;
      }

      .upImg-loading {
        position: relative;
        left: 12px;
        top: 25px;
      }

      .imgshow-div {
        margin-right: 10px;
        float: left;
        width: 150px;
        height: 130px;
        position: relative;
        border: 1px solid #e2e2e2;
        padding: 10px;
      }

      .imgshow-img {
        width: 150px;
        height: 130px;
      }

      .imgshow-div i {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 18px;
        height: 19px;
        text-align: center;
        line-height: 20px;
        cursor: pointer;
        background: url('${ctx}/relfile/images/zgt/close.png');
      }
      .imgshow-div i:hover {
        background: url('${ctx}/relfile/images/zgt/close-red.png');
      }

      .imgLoading-show {
        height: 138px;
        border: 1px dashed #030303;
        width: 160px;
        float: left;
      }

      .imgshow-remove {
        border: none;
        cursor: pointer;
        display: block;
        background-color: #f35d3c;
        color: #fff;
        width: 160px;
        height: 30px;
        text-align: center;
        line-height: 30px;
      }

      .subjective-answeruser-button {
        width: 100px;
        height: 35px;
        background-color: #00a2e8;
        color: #fff;
        cursor: pointer;
        margin-right: 20px;
      }

      .subjective-answeruser-cancelbtn {
        width: 100px;
        height: 35px;
        color: #fff;
        cursor: pointer;
        margin-right: 20px;
      }

      .subjective-upload-answerfile {
        width: 185px;
        height: 45px;
        background-color: #00a2e8;
        color: #fff;
        margin-left: 12px;
        font-size: 18px;
        cursor: pointer;
      }

      .upload-answer-file {
        position: relative;
        left: 128px;
        top: 5px;
      }

      .upload-answer-loading {
        position: relative;
        bottom: 4px;
        left: 5px;
      }

      .subjective-base-div {
        margin: 20px 10px 10px 30px;
        border-bottom: 1px solid #e8e6e6;
        padding-bottom: 20px;
      }
    </style>
  </body>
</html>
